# Show service name on DQL Query

**URL:** <https://community.dynatrace.com/t/show-service-name-on-dql-query/48367>\
**Category:** DQL\
**Tags:** dql, services-classic, latest-dynatrace\
**Created:** [October 16, 2024, 12:31pm UTC](https://community.dynatrace.com/t/show-service-name-on-dql-query/48367 "2024-10-16T12:31:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![soportetr](https://avatars.discourse-cdn.com/v4/letter/s/c6cbf5/32.png) [@soportetr](https://community.dynatrace.com/u/soportetr)\
**Post date:** [October 16, 2024, 12:31pm UTC](https://community.dynatrace.com/t/show-service-name-on-dql-query/48367/1 "2024-10-16T12:31:09Z")

</div>

Hi everyone,

I am running a DQL query that shows which services call other services and which are called by another. Below I leave the query and the result:

 ![Captura de pantalla 2024-10-16 072923.png](https://global.discourse-cdn.com/dynatrace/original/2X/2/2e138542506b5798db35ebeaa035f32fe383323f.png)

What I need to know is that if there is a way to show the names of the services and not the ID’s of the services.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![DynaWiz](https://avatars.discourse-cdn.com/v4/letter/d/ecae2f/32.png) [@DynaWiz](https://community.dynatrace.com/u/DynaWiz)\
**Post date:** [October 16, 2024, 3:44pm UTC](https://community.dynatrace.com/t/show-service-name-on-dql-query/48367/2 "2024-10-16T15:44:19Z")

</div>

Hello&nbsp;[@soportetr](https://community.dynatrace.com/user/41008),

you can use lookup function:

```markup
fetch dt.entity.service
|fieldsAdd entity.customized_name
|fieldsAdd called_by,calls
|filter isNotNull(entity.customized_name)
|expand service1 = called_by[dt.entity.service]
|expand service2 = calls[dt.entity.service]
|fieldsAdd service1name = lookup([fetch dt.entity.service],
sourceField:service1 , lookupField:id)[entity.name]
|fieldsAdd service2name = lookup([fetch dt.entity.service],
sourceField:service2 , lookupField:id)[entity.name]

```

Best Regards

Michał

---

<div class="post-metadata">

**Author:** ![Fin\_Ubels](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/fin_ubels/32/18008_2.png) [@Fin\_Ubels](https://community.dynatrace.com/u/Fin_Ubels)\
**Post date:** [October 17, 2024, 1:20am UTC](https://community.dynatrace.com/t/show-service-name-on-dql-query/48367/3 "2024-10-17T01:20:21Z")

</div>

You could slightly simplify the above down using the entityName command. It would look something like:

```markup
fetch dt.entity.service
|fieldsAdd entity.customized_name
|fieldsAdd called_by,calls
|filter isNotNull(entity.customized_name)
|expand service1 = called_by[dt.entity.service]
|expand service2 = calls[dt.entity.service]
|fieldsAdd service1name = entityName(service1, type:"dt.entity.service")
|fieldsAdd service2name = entityName(service2, type:"dt.entity.service")

```

There is that command as well as entityAttr used for extracting entity attributes. Docs for which can be found here:&nbsp;[[General functions — Dynatrace Docs](https://docs.dynatrace.com/docs/platform/grail/dynatrace-query-language/functions/general-functions#entityName)]([General functions — Dynatrace Docs](https://docs.dynatrace.com/docs/platform/grail/dynatrace-query-language/functions/general-functions#entityName%5C))

---

<div class="post-metadata">

**Author:** ![soportetr](https://avatars.discourse-cdn.com/v4/letter/s/c6cbf5/32.png) [@soportetr](https://community.dynatrace.com/u/soportetr)\
**Post date:** [October 17, 2024, 9:54pm UTC](https://community.dynatrace.com/t/show-service-name-on-dql-query/48367/4 "2024-10-17T21:54:16Z")

</div>

Hi,

I have already managed to visualize the names of the services. But now it is showing duplicate data. I have tried using dedup, but it is still showing duplicate data.

---

<div class="post-metadata">

**Author:** ![CharlesPerez](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/charlesperez/32/26797_2.png) [@CharlesPerez](https://community.dynatrace.com/u/CharlesPerez)\
**Post date:** [July 11, 2025, 2:03am UTC](https://community.dynatrace.com/t/show-service-name-on-dql-query/48367/5 "2025-07-11T02:03:13Z")

</div>

Hi,

Have you tried using the fields command to specify the fields you only want to show?
