I'd like to change the picture icon in the gallery based on what status it is in. The status field is a choice field.
If(ThisItem.Status.Value="Requested",Icon.AddDocument,If(ThisItem.Status.Value="In Development",Icon.Compose,If(ThisItem.Status.Value="On Hold",Icon.Blocked,If(ThisItem.Status.Value="Published/Implemented",Icon.Publish)
Thank you to the both of you. They both worked!
Please do as my screenshot tested and its working:
------------------------------------------------------------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.
If you like my response, please give it a Thumbs Up.
Hi @EMA03356,
Did you write the formula in the Icon property of the Icon control? In case 'ThisItem.Status.Value' has the correct value, the correct Icon should be displayed. Can you confirm that the status column has the correct values?
(Make sure ThisItem.Status.Value has the same value as is being displayed in the subtitle label)
I tried this and it accepted the formula but did not change the other icons in the gallery.
I tried this and it accepted the formula but did not change the other icons in the gallery.
Hi @EMA03356,
In these cases a Switch function would be preferred over nested If() statements:
Switch(
ThisItem.Status.Value,
"Requested",
Icon.AddDocument,
"In Development",
Icon.Compose,
"On Hold",
Icon.Blocked,
"Published/Implemented",
Icon.Publish
)
Additionally, make sure all written values between quotes match the choice value exactly. Pay close attention to spaces or capitalization.
If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.
Thanks!
try this
If(
ThisItem.Status.Value="Requested",
Icon.AddDocument,
ThisItem.Status.Value="In Development",
Icon.Compose,
ThisItem.Status.Value="On Hold",
Icon.Blocked,
ThisItem.Status.Value="Published/Implemented",
Icon.Publish
)
------------------------------------------------------------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.
If you like my response, please give it a Thumbs Up.
WarrenBelz
146,660
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional