Notifications
Announcements
Hello,
In my Power App, there is a "Star" icon (which doesn't have all the events like other icons). When I click on the Star, it should turn gold (the function is already provided - clicking adds the selected item to the Favorites list for the current user). Also, the user must be able to remove the selected item from the Favorites list by clicking on the "X," and the star should return to its colorless state. Thank you for your help!
Patch( DataSource, ThisItem, { Favourite: If( ThisItem.Favourite = "Yes", "No", "Yes" ) } )
If( ThisItem.Favourite = "Yes", Color.Yellow, Color.White )
ClearCollect( Documents, { Doc: "Doc1.docx", ID: 1 }, { Doc: "Doc2.docx", ID: 2 }, { Doc: "Doc3.docx", ID: 3 }, { Doc: "Doc4.docx", ID: 4 } );
ClearCollect( User_Favorites, { Email: "----E-Mail Address---", Favorites: "1,2" }, { Email: "----E-Mail Address---", Favorites: "3,2" }, { Email: "----E-Mail Address---", Favorites: "1,3" }, { Email: "----E-Mail Address---", Favorites: "4,2" } );
If( ThisItem.ID in Split( LookUp( User_Favorites, Email = User().Email ).Favorites, "," ), Color.Gold, Color.White )
Patch( User_Favorites, If( IsBlank( LookUp( User_Favorites, Email = User().Email ) ), Defaults(User_Favorites), LookUp( User_Favorites, Email = User().Email ) ), { Favorites: If( ThisItem.ID in Split( LookUp( User_Favorites, Email = User().Email ).Favorites, "," ), Concat( Filter( Gallery1.AllItems, Star1.Fill = Color.Gold && !(ID = ThisItem.ID) ), ID, "," ), Concatenate( Concat( Filter( Gallery1.AllItems, Star1.Fill = Color.Gold && !(ID = ThisItem.ID) ), ID, "," ), ",", ThisItem.ID ) ) } );
LookUp(User_Favorites, Email = User().Email).Favorites
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.
In our never-ending quest to improve we are simplifying the forum hierarchy…
We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
WarrenBelz 739 Most Valuable Professional
Michael E. Gernaey 343 Super User 2025 Season 2
Power Platform 1919 268