# variable setting drop down - show service name but pick service ID?

**URL:** <https://community.dynatrace.com/t/variable-setting-drop-down-show-service-name-but-pick-service-id/53094>\
**Category:** DQL\
**Tags:** dql, dynatrace-managed\
**Created:** [August 25, 2025, 5:01pm UTC](https://community.dynatrace.com/t/variable-setting-drop-down-show-service-name-but-pick-service-id/53094 "2025-08-25T17:01:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![imrj99](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/imrj99/32/21367_2.png) [@imrj99](https://community.dynatrace.com/u/imrj99)\
**Post date:** [August 25, 2025, 5:01pm UTC](https://community.dynatrace.com/t/variable-setting-drop-down-show-service-name-but-pick-service-id/53094/1 "2025-08-25T17:01:34Z")

</div>

when creating the dropdown pick for selecting a value for services using the following DQL

_fetch dt.entity.service_  
_| expand managementZones_  
_| filter in(managementZones, $ManagementZone) or in($ManagementZone, “All”)_  
_| dedup id_  
_| fields id_

how can it be changed for the drop down to show the (human friendly) service name only instead of the service ID, but still keep the variable value to the service ID only?

Prefer to keep service ID as several elements on the dashboard already use the service ID value from this variable

---

<div class="post-metadata">

**Author:** ![deni](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/deni/32/163_2.png) [@deni](https://community.dynatrace.com/u/deni)\
**Post date:** [August 25, 2025, 9:57pm UTC](https://community.dynatrace.com/t/variable-setting-drop-down-show-service-name-but-pick-service-id/53094/2 "2025-08-25T21:57:19Z")

</div>

Hi [@imrj99](https://community.dynatrace.com/user/73678) ,

 ![deni_0-1756158989815.png](https://global.discourse-cdn.com/dynatrace/original/3X/0/2/021c2a0b19f7d5d379c6c0039354a0c01915ce66.png)

```markup
fetch dt.entity.service
| expand managementZones
| filter in(managementZones, "Cloud: Azure") or in("Cloud: Azure", "All")
| dedup id
| fields entity.name

```

Regards, Deni

---

<div class="post-metadata">

**Author:** ![imrj99](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/imrj99/32/21367_2.png) [@imrj99](https://community.dynatrace.com/u/imrj99)\
**Post date:** [August 25, 2025, 11:55pm UTC](https://community.dynatrace.com/t/variable-setting-drop-down-show-service-name-but-pick-service-id/53094/3 "2025-08-25T23:55:53Z")

</div>

yea sorry i neglected to say I tried that, that will show the entity.name but then the variable gets assigned the entity.name, not the entity.id.

its like I need to hide the entity.id from the drop down and only show entity.name, but actually keep the entity.id of the selected entity.name to be assigned to the variable, if that makes sense.

---

<div class="post-metadata">

**Author:** ![p\_devulapalli](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/p_devulapalli/32/41590_2.png) [@p\_devulapalli](https://community.dynatrace.com/u/p_devulapalli)\
**Post date:** [August 26, 2025, 12:33am UTC](https://community.dynatrace.com/t/variable-setting-drop-down-show-service-name-but-pick-service-id/53094/4 "2025-08-26T00:33:39Z")

</div>

[@imrj99](https://community.dynatrace.com/user/73678)&nbsp;You can try using two variables One variable that populates the entity names and the second variable that populates the Id based on the entity name selected

Here is an example

Variable1

```markup
fetch dt.entity.service
| expand managementZones
| filter in(managementZones, $ManagementZone) or in($ManagementZone, "All")
| dedup id
| fields entity.name

```

Variable2

```markup
fetch dt.entity.service
| filter in(entity.name, {$Variable1})
| fields id

```

On the dashboard you can keep the first variable visible and hide the second variable from the view. End user would select the entity name from the dropdown and that would update variable2 which is the id . You can still keep referencing variable2 in your dashboard views

Hope this helps

---

<div class="post-metadata">

**Author:** ![imrj99](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/imrj99/32/21367_2.png) [@imrj99](https://community.dynatrace.com/u/imrj99)\
**Post date:** [August 26, 2025, 12:29pm UTC](https://community.dynatrace.com/t/variable-setting-drop-down-show-service-name-but-pick-service-id/53094/5 "2025-08-26T12:29:24Z")

</div>

awesome, that worked, thanks a lot!
