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.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
11manish 405 Super User 2026 Season 2
Mohsin Ali 368
WarrenBelz 244 Most Valuable Professional