Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Display icon in a label within gallery

(0) ShareShare
ReportReport
Posted on by 714 Super User 2025 Season 1

I'm trying to do the following inside a datacard in a gallery. I also attempted to add an Icon with conditional display but can't get the icon control inside the datacard.

 

What I want to do is display ThumbsUp or ThumbsDown depending on the underlying yes/no in the SP list. I thought this would be easy but I cannot for the life of me figure out the syntax.

 

Here are the things I've tried already within one big code block. The top works and displays "true" or "false".

 

 

ThisItem.Completed

//If(ThisItem.Completed, ":thumbsup:", "Nope")

//If(ThisItem.Completed, Icon.ThumbsUpFilled, "Nope")

/*If(
 ThisItem.Completed,
 Icon.ThumbsUp,
 Icon.ThumbsDown
)*/

 

 

The three commented attempts above all result in the correct evaluation but show the text within the logic and not the Icon itself.

Categories:
  • Verified answer
    DCHammer Profile Picture
    714 Super User 2025 Season 1 on at
    Re: Display icon in a label within gallery

    I figured it out. Seems you can't do it in the Tree View. Or at least I couldn't.

    Solution was to click on the Gallery in the Canvas, click the Pencil icon to Edit the Gallery, then Insert. 

    Bob's your uncle. Thank you for attending DC's Powerapps for Fools.

    Appearing daily as he solves silly problems and then tells himself he's a genius.

  • DCHammer Profile Picture
    714 Super User 2025 Season 1 on at
    Re: Display icon in a label within gallery

    Both of those things will work if I put an Icon outside of the gallery item.  But that doesn't really solve my problem.

    I want a visual indicator inside the ThisItem based on the underlying value.

     

    When I add "Completed" as a Field, it automatically adds it as a Label and populates it with true or false which obviously corresponds to Yes/No in the SP list.

     

    Instead of displaying true or false, I want to convert that into a visual.

     

    I have this kind of thing working for a chevron indicating sorting. But that's outside of a gallery.

     

    What I'm trying to figure out how to do is have an icon inside of a gallery that's dependent on the source data.

     

  • CU-18081211-6 Profile Picture
    9,266 Super User 2025 Season 1 on at
    Re: Display icon in a label within gallery

    @DCHammer ,

    You can't include an icon in a label. Use an icon control for that over the label control and put it as is suitable for you. 

    The code:

     

    If(
     ThisItem.Completed,
     Icon.ThumbsUp,
     Icon.ThumbsDown
    )

     

    should work. 

    Hope it helps !

  • SpongYe Profile Picture
    5,580 Super User 2025 Season 1 on at
    Re: Display icon in a label within gallery

    Hi @DCHammer 

     

    You need to use the Icon property of the icon control to specify which icon to display, not the Text property. The Text property is for labels, not icons.

     

    So, your formula for the icon control should look like this:

    Icon = If(ThisItem.Completed, Icon.ThumbsUp, Icon.ThumbsDown)

    SpongYe_0-1697132910926.png

     

    Visible = If(ThisItem.Completed, true, false)

     

    SpongYe_1-1697132944922.png

     

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,653 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard