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 / Change Image OnSelect
Power Apps
Answered

Change Image OnSelect

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello Everyone, 
I am trying the hole day but it seems I can not figure it out.

I have a Gallery with 7 Award Categorys. Every Award has its own Image (I have created on the start of my app)

ClearCollect(AllAward_Types,
{PrimaryId: 1, Type:"Extra-Meile",Award_Color: "#2DAAE1", Description: "The Helpful Feedback Award badge is given to the person who gave critical insight on another person's work.", Icon: 'Extra-Meile' ,Selected:false}......)

Now I have a get the Images but I want every time I click on one of them to change, I have tried to create a collection with the type of award and another image per type and then used this formula

If(ThisItem.IsSelected, LookUp(HoverIcons, Type=ThisItem.Type).Icon,ThisItem.Icon)

But it doesn't seem to work.

 

I would be grateful for an answer!

Categories:
  • WarrenBelz Profile Picture
    156,963 Most Valuable Professional on at

    @Anonymous ,

    That is because you cannot refer to objects dynamically - if ThisItem.Type = "Save" (a String), an Icon of Icon.Type does not work - it has to be Icon.Save.

    You would need to hard-code it all.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @WarrenBelz  Thank you for your response, could you give me an example of what do you mean hardcoding all? 

    and also do you mean I need to hard code them onStart?

  • Verified answer
    WarrenBelz Profile Picture
    156,963 Most Valuable Professional on at

    Hi @Anonymous ,

    I am assuming Extra-Meile is a standard icon type in German. If so, using your syntax

    If(
     ThisItem.IsSelected, 
     Switch(
     LookUp(
     HoverIcons, 
     Type=ThisItem.Type
     ).Icon,
     "Extra-Meile",
     Extra-Meile,
     "Save",
     Save,
     ThisItem.Icon
     )
    )

    and the rest would follow down (between the Save example and ThisItem.Icon)

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 220 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 139

Last 30 days Overall leaderboard