web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Insert a different ico...
Power Apps
Unanswered

Insert a different icon into a gallery, dependant upon Status

(0) ShareShare
ReportReport
Posted on by 438

Hi

 

I am creating a Permit status App and am wanting to Insert a different Icon into the gallery dependant upon the Status value in the SharePoint list. Ie If Complete, a Green Tick, If the Permit is live it would be a Red Cross and something else to indicate the permit is planned but not yet under way.

 

I have been thinking about using a formula about changing the visibility of each icon, dependant upon the value. But I am not really sure where to start.

 

Categories:
I have the same question (0)
  • DJ_Jamba Profile Picture
    2,837 Super User 2025 Season 2 on at

    Hi @nshaw75 

    Use Switch:

    Throw any icon into the gallery and in the Icon property of the icon:

     

    Switch(
     ThisItem.Status, //name of your status column
     "live",
     Icon.CancelBadge,
     "complete",
     Icon.CheckBadge,
     Icon.CalendarBlank
    )

     

     

    And because you mentioned colours, put this in the Color property of the icon:

     

    Switch(
     ThisItem.Status, //name of your status column
     "live",
     Color.DarkRed,
     "complete",
     Color.DarkGreen,
     Color.DarkBlue
    )

     

     

    You could go a step further and put this in the Tooltip property of the icon:

    ThisItem.Status //name of your status column

     

     

    Result:

     

    DJ_Jamba_1-1711809622627.png

     

     

  • nshaw75 Profile Picture
    438 on at

    Hi @DJ_Jamba , many thanks for the help. I have copied the formula as above, changing the text 

    name of your status column

     to " Status " and the error details are saying I am missing an Operator between the Operands. I also added, in the same syntax as the formula above, the Planned item. 

    Icon.CancelBadge,
        "Complete",
        Icon.CheckBadge,
        "Planned",
        Icon.CalendarBlank
    )
     
     
  • DJ_Jamba Profile Picture
    2,837 Super User 2025 Season 2 on at

    Show me the code you've entered please

  • nshaw75 Profile Picture
    438 on at
    Hi i have just cut this straight from the formula bar
     
    Switch(
        ThisItem.Status, //status
        "Live",
        Icon.CancelBadge,
        "Complete",
        Icon.CheckBadge,
        "Planned",
        Icon.CalendarBlank
    )
  • DJ_Jamba Profile Picture
    2,837 Super User 2025 Season 2 on at

    Is Status the name of your column in SharePoint or is it status?

  • nshaw75 Profile Picture
    438 on at

    Ah Yes the column is Status. Although I have changed this, the error is reporting that the function is expecting a record. This is no doubt due to the column being a choice column

     

  • Verified answer
    DJ_Jamba Profile Picture
    2,837 Super User 2025 Season 2 on at

    Try:

    Switch(
     ThisItem.Status.Value,
     "Live",
     Icon.CancelBadge,
     "Complete",
     Icon.CheckBadge,
     "Planned",
     Icon.CalendarBlank
    )
  • nshaw75 Profile Picture
    438 on at

    Fantastic, Thank you very much for your help. 😃

  • DJ_Jamba Profile Picture
    2,837 Super User 2025 Season 2 on at

    You're welcome!

    d(-_-)b

  • nshaw75 Profile Picture
    438 on at

    @DJ_Jamba , Thanks again for the help. As you mentioned early on in the thread you can add colours to the formula, can this be done as well as changing the icon?

    I have tried to insert the  following, to change the Live icon to red and it hasn't worked. 

     

    Switch(
        ThisItem.Status.Value,
        "Live",
        Color.DarkRed,
        Icon.CancelBadge,
        "Complete",
        Icon.CheckBadge,
        "Planned",
        Icon.CalendarBlank
    )

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard