# GET - custom\_field.multi\_enum\_value

**URL:** <https://forum.asana.com/t/get-custom-field-multi-enum-value/588836>\
**Category:** API & Developers\
**Tags:** custom-fields, tasks\
**Created:** [31 October 2023 04:34 UTC](https://forum.asana.com/t/get-custom-field-multi-enum-value/588836 "2023-10-31T04:34:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andy\_Pilipovic](https://luna1.co/8d76cd.png) [@Andy\_Pilipovic](https://forum.asana.com/u/Andy_Pilipovic)\
**Post date:** [31 October 2023 04:34 UTC](https://forum.asana.com/t/get-custom-field-multi-enum-value/588836/1 "2023-10-31T04:34:07Z")

</div>

Hello!

I’m using Python and I am wondering if there is a way to get a gid value of a multi enum field selection.

Currently I have been using custom\_fields.display\_value however when I want to POST the display\_value to another task I noticed that the param needs to contain the gid of the custom field as well as the key of the value where all I am able to GET is the value name.

Am I missing something or is this simply not a functionality and I’d have to figure out a way to match the display name to the key on the client side?

Thanks!

---

<div class="post-metadata">

**Author:** ![Andy\_Pilipovic](https://luna1.co/8d76cd.png) [@Andy\_Pilipovic](https://forum.asana.com/u/Andy_Pilipovic)\
**Post date:** [31 October 2023 17:26 UTC](https://forum.asana.com/t/get-custom-field-multi-enum-value/588836/2 "2023-10-31T17:26:53Z")

</div>

Hello everyone,

I took care of this on the client side however I’ll leave the topic open in case anyone else runs into the same issue.

---

<div class="post-metadata">

**Author:** ![John\_Vu](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/john_vu/32/97235_2.png) [@John\_Vu](https://forum.asana.com/u/John_Vu)\
**Post date:** [31 October 2023 18:15 UTC](https://forum.asana.com/t/get-custom-field-multi-enum-value/588836/3 "2023-10-31T18:15:07Z")

</div>

Hi @Andy_Pilipovic,

Glad you figure this out. For the folks who stumble across this post, you can access the `gid` of the selected enum values for a multi-select enum custom field by asking for the `custom_fields.multi_enum_values` in the `opt_fields` query params.

**Context:**  
`custom_fields.multi_enum_values` → if your custom field is a `multi_enum` type (i.e., `'resource_subtype': 'multi_enum'`) this contains information about the `enum_values` that was selected.

`custom_fields.display_value` → regardless of custom\_field type this will return the text value of that custom field

`custom_fields.enum_options` → if your custom field is a `multi_enum` type (i.e., `'resource_subtype': 'multi_enum'`) this will return the available enum options for that multi-select custom field.

Here’s what the usage might look like for the python client ([v3.2.2](https://pypi.org/project/asana/3.2.2/)):

```plaintext
import asana
from pprint import pprint

client = asana.Client.access_token("<YOUR_PERSONAL_ACCESS_TOKEN>")
task_gid = "<YOUR_TASK_GID>"

result = client.tasks.get_task(task_gid, fields="custom_fields.name,custom_fields.display_value,custom_fields.multi_enum_values,custom_fields.enum_options")
pprint(result)

```

This is an example response from the code above:

```plaintext
{'custom_fields': [{'display_value': 'Option 1',
                    'enum_options': [{'color': 'green',
                                      'enabled': True,
                                      'gid': '<ENUM_OPTION_1_GID>',
                                      'name': 'Option 1',
                                      'resource_type': 'enum_option'},
                                     {'color': 'red',
                                      'enabled': True,
                                      'gid': '<ENUM_OPTION_2_GID>',
                                      'name': 'Option 2',
                                      'resource_type': 'enum_option'}],
                    'gid': '<CUSTOM_FIELD_GID>',
                    'multi_enum_values': [{'color': 'green',
                                           'enabled': True,
                                           'gid': '<ENUM_OPTION_1_GID>',
                                           'name': 'Option 1',
                                           'resource_type': 'enum_option'}],
                    'name': 'Multi-Select'}],
 'gid': '<TASK_GID>'}

```

Notice that `multi_enum_values ` has extra information for the value in the `display_value` and notice that `enum_options` returns the available `enum_options` for this specific multi-select custom field.

You can apply this `opt_fields` trick with [Get multiple tasks](https://developers.asana.com/reference/gettasks) endpoint as well.

EX:

```plaintext
import asana
from pprint import pprint

client = asana.Client.access_token("<YOUR_PERSONAL_ACCESS_TOKEN>")
project_gid = "<YOUR_PROJECT_GID>"

result = client.tasks.get_tasks({"project": [project_gid]}, fields="custom_fields.name,custom_fields.display_value,custom_fields.multi_enum_values,custom_fields.enum_options")
pprint(list(result))

```

* * *

**TIP:** Look at the full schema of the resource that is being returned to understand what values you can request for in the `opt_fields` EX: if you are making calls to [Get multiple tasks](https://developers.asana.com/reference/gettasks), [Get a task](https://developers.asana.com/reference/gettask) you can look at the [full task schema](https://developers.asana.com/reference/tasks#task) and read about the properties that is available.

Another trick is to look at the listed options in `opt_fields` drop down for those endpoints.

EX:

 ![opt_fields](https://us1.discourse-cdn.com/asana/original/3X/5/1/51f540d7557dfb9e1856f5a23684f638f354952c.jpeg)

---

<div class="post-metadata">

**Author:** ![Andy\_Pilipovic](https://luna1.co/8d76cd.png) [@Andy\_Pilipovic](https://forum.asana.com/u/Andy_Pilipovic)\
**Post date:** [31 October 2023 18:38 UTC](https://forum.asana.com/t/get-custom-field-multi-enum-value/588836/4 "2023-10-31T18:38:23Z")

</div>

Thanks for clarifying @John_Vu 🦾

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/system/32/276370_2.png) [@system](https://forum.asana.com/u/system)\
**Post date:** [7 November 2023 18:38 UTC](https://forum.asana.com/t/get-custom-field-multi-enum-value/588836/5 "2023-11-07T18:38:30Z")

</div>

Closed on 7 November 2023 18:38 UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
