Forum Discussion

Christophe Humbert's avatar
Christophe Humbert
Iron Contributor
Apr 19, 2019
Solved

Conditional icon

I need my PowerApps icon control to display either a red cross or a green check depending on a condition. How can I achieve this in PowerApps? The icon control forces me to pick a specific icon.
  • Christophe Humbert's avatar
    Apr 19, 2019

    The icon property of the icon control displays as a drop-down when we look at the standard properties, but I found out that if I switch to advanced properties it allows me to enter a function.

     

    In my case I was able to use a switch statement:

    Switch(ThisItem.Status.Value,"Success",Check,"Fail",Cancel)

     

    where Check and Cancel are the icon names.

     

    ChrisWebbTech 's method would work too, but requires two controls for each icon (I have a bunch of them on my dashboard).

     

    It seems that another method would have been to use html/JavaScript to insert graphics in a html control. I found some documentation but didn't test it.

Resources