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 / icon controls - how to...
Power Apps
Answered

icon controls - how to change icon image

(0) ShareShare
ReportReport
Posted on by

I'm wanting to change an icon image from "Edit" to "Save", I'm using a variable to store value and assigning the variable to the icon property.

Changeicon.Onselect = Set(varChangeIcon, "Save");Set(varChangeTooltip, "Save")

Reseticon.Onselect = Set(varChangeIcon, "Edit");Set(varChangeTooltip, "Edit")

Icon.icon = varChangeIcon

Icon.Tooltip = varChangeTooltip

icon_1.PNG

When I run this, only the Text to display while hoovering is working, the image is blank but the function within the icon.OnSelect works. Can this be done? changing the image?

 

Categories:
I have the same question (0)
  • Verified answer
    mdevaney Profile Picture
    29,989 Moderator on at

    @nvpc 

    Can you please try this code instead and let me know the result?  Your code changes the Icon property to text data type but we need to change it to a enum value instead (e.g Icon.Save is an enum).

     

    Icon.icon = Switch(varChangeIcon,"Save",Icon.Save,"Edit,Icon.Edit)

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • nvpc Profile Picture
    on at

    Thank you, your were missing a closing quote but it worked!!! can you explain the difference?

    Switch(varChangeIcon,"Save",Icon.Save,"Edit",Icon.Edit)

  • mdevaney Profile Picture
    29,989 Moderator on at

    @nvpc 

    Yes.  Your solution put the value "Save" in the Icon property.  Save is a text string.  My solution put Icon.Save in the Icon property.  Icon.Save is a reference to the Save image.  That's why it did not work initially.

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 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard