# Use "If" based on the variable to show an image

**URL:** <https://community.dynatrace.com/t/use-if-based-on-the-variable-to-show-an-image/47464>\
**Category:** Dashboarding\
**Tags:** dashboards\
**Created:** [September 3, 2024, 7:15pm UTC](https://community.dynatrace.com/t/use-if-based-on-the-variable-to-show-an-image/47464 "2024-09-03T19:15:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wellpplava](https://avatars.discourse-cdn.com/v4/letter/w/d26b3c/32.png) [@wellpplava](https://community.dynatrace.com/u/wellpplava)\
**Post date:** [September 3, 2024, 7:15pm UTC](https://community.dynatrace.com/t/use-if-based-on-the-variable-to-show-an-image/47464/1 "2024-09-03T19:15:03Z")

</div>

Hello!

Is it possible to use the “code” of the new dashboard version to display an image using a URL through the variable selected in the dashboard?

The idea is to display the corresponding image of the product selected in the variable.

---

<div class="post-metadata">

**Author:** ![ChadTurner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chadturner/32/161_2.png) [@ChadTurner](https://community.dynatrace.com/u/ChadTurner)\
**Post date:** [December 30, 2024, 7:49pm UTC](https://community.dynatrace.com/t/use-if-based-on-the-variable-to-show-an-image/47464/2 "2024-12-30T19:49:32Z")

</div>

You can put images on a dashboard, however, I don’t think you can add in logic so when you lick windows sever the image goes from a Linux Logo to a Windows logo. Or selecting a VMware host vs onprem host. maybe with workflows to update the image on the dashboard but that would result in the need of constant refreshing.

---

<div class="post-metadata">

**Author:** ![pcifuef](https://avatars.discourse-cdn.com/v4/letter/p/d6d6ee/32.png) [@pcifuef](https://community.dynatrace.com/u/pcifuef)\
**Post date:** [January 20, 2026, 5:24am UTC](https://community.dynatrace.com/t/use-if-based-on-the-variable-to-show-an-image/47464/3 "2026-01-20T05:24:12Z")

</div>

Hi, perhaps you’ve already solved your question, but we did it the following way:

1. Add your image repository in **Settings** → **Allowed URL pattern rules**.
2. Add a table query like this to your notebook / dashboard, Display the image in the table if the error count for my service exceeds 50.:

fetch bizevents  
| filter contains(event.type,“web.event.”)  
| filter class == “Error”  
| summarize count(), by:{service}  
**| filter `count()` \> 50**  
**| fieldsAdd URL\_IMG= “YOUR\_IMG/GIF\_URL(from step1)”**  
**| fieldsAdd IMG= concat(“![](”,URL\_IMG,“)”)**

3. In the table’s Visual options, look for the Custom column types setting and add the “IMG” column as a Markdown type.

✌🏻😁&nbsp;I hope I’m not too late to help!
