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

Community site session details

Session Id : joFDSnkcSadLtv89hvJTEy
Power Apps - Building Power Apps
Answered

How to insert an image/icon in gallery based on conditions

Like (1) ShareShare
ReportReport
Posted on 28 Oct 2021 18:25:01 by 101

Hello, I am attempting to add a few images to my gallery based on the value in one of my columns, 'Status'.

Ideally, I have 3 images I want to include based on the 3 entries for 'Status' such as "Paid", Status is Blank, and "Written Off".
However, I tried to find an easier solution by just using the icons already offered by Power Apps.

Status is not one of the SP columns included in my gallery. Is that the problem? Is it the syntax?

powerappshelp.png

Any help is appreciated! 

Categories:
  • poweractivate Profile Picture
    11,078 Most Valuable Professional on 28 Oct 2021 at 18:45:57
    Re: How to insert an image/icon in gallery based on conditions

    @water-guy-5 wrote:

    Status is not one of the SP columns included in my gallery. Is that the problem? Is it the syntax?



    @water-guy-5 I think the problem might be both.

     

    So you can try something like this (below is a pseudo formula - please replace values with what makes sense for you below)

     

     

     

     

     

    If(ThisItem.SomeColumn = "Paid",CheckBadge,If(ThisItem.SomeColumn = "Written Off",CancelBadge,DefaultBadge))

     

     

    or

     

    If(IsBlank(ThisItem.SomeColumn),BlankBadge, If(ThisItem.SomeColumn = "Paid",CheckBadge,If(ThisItem.SomeColumn = "Written Off",CancelBadge,DefaultBadge)))

     

    Check if above helps.

  • Verified answer
    abrae005 Profile Picture
    161 on 28 Oct 2021 at 18:44:24
    Re: How to insert an image/icon in gallery based on conditions

    Try 

    If(ThisItem.Status.Selected.Value = "Paid", CheckBadge);
    If(ThisItem.Status.Selected.Value = "Written Off", CancelBadge)

     

    Really, you could probably do this as a nested If statement - you didn't mention what icon you wanted for the 3rd option, so I just chose "Trash", but obviously, choose your own icons 🙂 ... Or just leave blank to have none

    If(ThisItem.Status.Selected.Value = "Paid", CheckBadge, If(ThisItem.Status.Selected.Value = "Written Off, CancelBadge, Trash))

     

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete