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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Display icon in a labe...
Power Apps
Answered

Display icon in a label within gallery

(0) ShareShare
ReportReport
Posted on by 716 Moderator

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:
I have the same question (0)
  • SpongYe Profile Picture
    5,715 Super User 2026 Season 1 on at

    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! 🍻

     

  • CU-18081211-6 Profile Picture
    9,270 Moderator on at

    @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 !

  • DCHammer Profile Picture
    716 Moderator on at

    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.

     

  • Verified answer
    DCHammer Profile Picture
    716 Moderator on at

    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.

  • PeterCBell_au Profile Picture
    109 on at
    For anyone reading this, what I wanted to do was change an icon using a text name. Gemnini struggled to answer this. I finally remembered the prefix I had seen somewhere and let Gemini know. Here is the AI summary of what to do if you want to change the icon to be displayed using a text name, which will commonly be convenient, especially if creating a gallery.
     
    Here is the AI list of classic icons
       [ "Add", "AddLibrary", "AddUser", "Adjust", "Airplane", "Archive", "Assembly", "Asset", "Assistant", 
        "Attach", "Back", "BackToWindow", "Badge", "Balloon", "Barcode", "BarcodeScanner", "Battery", 
        "Book", "Bookmark", "Briefcase", "Calculator", "Calendar", "Camera", "Cancel", "Certificate", 
        "Chart", "Check", "CheckBadge", "ChevronDown", "ChevronLeft", "ChevronRight", "ChevronUp", 
        "Circle", "Clock", "Cloud", "Code", "Collapse", "ColorFiller", "Comment", "Compass", "Computer", 
        "Contact", "Copy", "Crop", "Database", "Desktop", "Details", "Directions", "Document", 
        "DocumentLibrary", "Download", "Edit", "Emoji", "Erase", "Error", "Expand", "Export", 
        "ExternalLink", "Filter", "Flag", "Folder", "Forward", "Globe", "Grid", "Group", "History", 
        "Home", "Image", "Import", "Information", "InplaceEdit", "Journal", "Key", "Laptop", 
        "Layers", "Layout", "Link", "List", "Lock", "LogJournal", "Mail", "Map", "Meeting", "Menu", 
        "Message", "Mic", "Mobile", "Money", "More", "Music", "Next", "Note", "Notification", "Open", 
        "Outgoing", "Paperclip", "Pause", "People", "Person", "Phone", "Pin", "Play", "Power", 
        "Presentation", "Print", "PurchaseOrder", "Question", "Receipt", "Redo", "Reload", "Remove", 
        "Repair", "Save", "Search", "Send", "Settings", "Share", "Shield", "ShoppingBag", "ShoppingCart", 
        "Star", "Status", "Stop", "Subscribe", "Table", "Tag", "Target", "Ticket", "Timeline", 
        "Tools", "Trash", "Trending", "Trophy", "Truck", "Undo", "Unlock", "Upload", "User", "Video", 
        "View", "Volume", "Warning", "Website", "WiFi", "Work", "World", "ZoomIn", "ZoomOut"  ]
     
     

    Spot on. You are absolutely correct, and I appreciate the nudge to get specific on that exact string literal.

    When you are treating the Icon property as a string—specifically when building dynamic galleries or components—the prefix "builtinicon:" is the secret sauce that allows PowerApps to resolve a text string into a rendered classic icon.

    Why "builtinicon:" is the move

    Using the Icon.Name enum is fine for static logic, but as you’ve identified, it fails when you're trying to drive an icon's appearance via data (like a column in a table or a Gallery). By concatenating that prefix, you bypass the need for a massive Switch() statement.

    How it looks in practice:

    If your Gallery Items property is ["Add", "Cancel", "Search", "ChevronDown"], your Icon control's property would be:

    $"builtinicon:{ThisItem.Value}"


    Implementation Table

    To make sure the "properly cased" names match what the engine expects, here is a quick reference for common icons using your logic:

    User-Friendly Name Resulting String Value
    Add builtinicon:Add
    ChevronDown builtinicon:ChevronDown
    Filter builtinicon:Filter
    Trash builtinicon:Trash
    Edit builtinicon:Edit

    Important Caveat: Case Sensitivity

    Since you mentioned using the name "as displayed in the icon select drop down," keep in mind that the engine is case-sensitive for this specific string method.

    • Works: builtinicon:ChevronDown

    • Fails: builtinicon:chevrondown

    Pro-Tip: If you are pulling these names from a source where the casing might be messy, you can't easily Proper() your way out of it because ChevronDown has two capitals. It’s best to keep your data source strictly aligned with the PowerApps internal naming convention.

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 519 Most Valuable Professional

#2
11manish Profile Picture

11manish 489

#3
Haque Profile Picture

Haque 327

Last 30 days Overall leaderboard