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 / Changing Color of Sele...
Power Apps
Answered

Changing Color of Selected Item's Icon In Gallery

(0) ShareShare
ReportReport
Posted on by 58

I currently have an Icon in a gallery and a button outside of the gallery and I want the button to change the color of the icon when pressed. 

 

I also only want the item selected in the gallery's Icon to change colors.

 

Any ideas?

 

 

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @jNelly 

    in the button: UpdateContext({clr:true}) or

    toggled button: UpdateContext(clr:!clr})

    in the icon color property: If(ThisItem.IsSelected && clr, Red, Blue)

  • jNelly Profile Picture
    58 on at

    Okay so that changed the color of the icon to red which is good but I want the items icon that was selected when the button was pushed to stay red.

     

    Because now when I click on another item it automatically changes its color to red before I push the button and the old item I had selected when I pushed the button changes back to blue.

  • jNelly Profile Picture
    58 on at

    If it helps I could update a column from my data source named status by the push of the button to change the color for the selected item I just need help doing that. 

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @jNelly,

    Do you want to make the icon of the selected item change colour when you click a button outside the Gallery?

     

    If you could accept adding a column like Status to make difference, that's would be easier to achieve your need.

    1). Add a Text column to your list

    2). Once you select an item from the Gallery, click the button to update the corresponding status as Color. Set the Onselect property of the button outside the gallery as below:

    Patch(ListName,Gallery9.Selected,{Status:"Color"})
    

    3). Make the Fill property of the icon as below:

    If(ThisItem.Status="Color",Red)

     

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

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard