cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
jpmarcy
Level: Powered On

Conditional Formatting on Two Different Collections Using ForAll/Patch

Hello - I am trying to change the color of a label in one gallery to green after it finds a match in another gallery (all matches). In the screenshot below, you can see how this app works. The top button gallery acts as a filtering mechanism for the 2 galleries beneath. The bottom left gallery has its own collection, the bottom right gallery has its own collection, and the buttons above filter the galleries based on the team name.

 

Currently, only one of the Approved Games list games is recognized as a match even if there clearly multiple matches. I'm guessing I need to setup a loop to record multiple matches in the Sponsored Games collection after each button is selected, but I can't seem to figure that out. I have a match boolean column ready to go in the Sponsored Games collection; I just need to figure out the loop/patch formula.

 

Any guidance would be much appreciated. Thanks!

PowerAppCapture.PNG

 

1 ACCEPTED SOLUTION

Accepted Solutions
jpmarcy
Level: Powered On

Re: Conditional Formatting on Two Different Collections Using ForAll/Patch

This ended up working for me. On the Color property of the Sponsored Games label: 

 

If(lbl_SponsoredGame.Text in Gal_ApprovedGames.AllItems.Game,Green,Red)
2 REPLIES 2
jpmarcy
Level: Powered On

Re: Conditional Formatting on Two Different Collections Using ForAll/Patch

Here is the ForAll loop I cannot get working due to "Invalid Argument type" on the = operator.

 

ForAll(colApprovedGames,
        If(
          colApprovedGames.Game=colSponsoredGames.Display,
            Patch(colSponsoredGames,
              Defaults(colSponsoredGames),
              {Match:true})
          )   
 )
jpmarcy
Level: Powered On

Re: Conditional Formatting on Two Different Collections Using ForAll/Patch

This ended up working for me. On the Color property of the Sponsored Games label: 

 

If(lbl_SponsoredGame.Text in Gal_ApprovedGames.AllItems.Game,Green,Red)

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 125 members 4,573 guests
Please welcome our newest community members: