cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

imrj99
Participant

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

 

 

4 REPLIES 4

deni
Advisor

Hi @imrj99 ,

deni_0-1756158989815.png

 

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

 

Regards, Deni

Dynatrace Integration Engineer at CodeAttest

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.

 

 

@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 

Phani Devulapalli

awesome, that worked, thanks a lot!

Featured Posts