25 Aug 2025
06:01 PM
- last edited on
26 Aug 2025
07:28 AM
by
MaciejNeumann
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
Solved! Go to Solution.
25 Aug 2025 10:57 PM
Hi @imrj99 ,
fetch dt.entity.service
| expand managementZones
| filter in(managementZones, "Cloud: Azure") or in("Cloud: Azure", "All")
| dedup id
| fields entity.name
Regards, Deni
26 Aug 2025 12:55 AM
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.
26 Aug 2025 01:33 AM
@imrj99 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
fetch dt.entity.service
| expand managementZones
| filter in(managementZones, $ManagementZone) or in($ManagementZone, "All")
| dedup id
| fields entity.name
Variable2
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
26 Aug 2025 01:29 PM
awesome, that worked, thanks a lot!