# Accessing HumanUser login field on API .find()

**URL:** <https://community.shotgridsoftware.com/t/accessing-humanuser-login-field-on-api-find/3978>\
**Category:** Flow Production Tracking\
**Tags:** python-api\
**Created:** [November 26, 2019, 7:44pm UTC](https://community.shotgridsoftware.com/t/accessing-humanuser-login-field-on-api-find/3978 "2019-11-26T19:44:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dynendal](https://avatars.discourse-cdn.com/v4/letter/d/bb73d2/32.png) [@dynendal](https://community.shotgridsoftware.com/u/dynendal)\
**Post date:** [November 26, 2019, 7:44pm UTC](https://community.shotgridsoftware.com/t/accessing-humanuser-login-field-on-api-find/3978/1 "2019-11-26T19:44:00Z")

</div>

Hi there! How do I access login field for a HumanUser on a task\_assignee multi-entity? From the documentation, I thought it would be like this, but I’m not having any luck.

`sg.find(entity_type='Task', filters=[['task_assignees', 'is_not', None]], fields=['task_assignees', 'task_assignees.HumanUser.login',])`

---

<div class="post-metadata">

**Author:** ![DavidMason](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/davidmason/32/193_2.png) [@DavidMason](https://community.shotgridsoftware.com/u/DavidMason)\
**Post date:** [November 27, 2019, 9:19am UTC](https://community.shotgridsoftware.com/t/accessing-humanuser-login-field-on-api-find/3978/3 "2019-11-27T09:19:36Z")

</div>

Hi Dynendal,

Welcome to the forums, unfortunately the `task_assignees` field is a multi-entity field and cannot be searched through as it can return multiple values such as more than one person or a group/s.

You will need 2 commands, one to find the human user/ users, and then in that list of returned users/groups, you will need to have a lookup on the login value.

For example;

```python
# get all tasks with someone assigned
tasks = sg.find("Task", filters=[["task_assignees", "is_not", None]], fields=["task_assignees"])
# build a filter that will find all the user's based on the all the task's task_assignees fields.
user_filters = []
for a_task in tasks:
    for a_user in a_task["task_assignees"]:
        user_filters.append( ["id", "is", a_user["id"]] )
filters = [{"filter_operator": "any", "filters": user_filters}]
# which will generate something like this
# > [{'filter_operator': 'any', 'filters': [['id', 'is', 18], ['id', 'is', 21], ... ]}]
users = sg.find("HumanUser", filters, ["login"])
print users

```

However, this is not a project specific search and will not be very performant, just want to know what is the reason for gathering this data? Maybe we can find a better method if we know what the end result you are looking for is?

Hope that makes sense,  
Cheers

---

<div class="post-metadata">

**Author:** ![dynendal](https://avatars.discourse-cdn.com/v4/letter/d/bb73d2/32.png) [@dynendal](https://community.shotgridsoftware.com/u/dynendal)\
**Post date:** [November 28, 2019, 7:28pm UTC](https://community.shotgridsoftware.com/t/accessing-humanuser-login-field-on-api-find/3978/4 "2019-11-28T19:28:35Z")

</div>

Thanks! We went another route for efficiency’s sake.
