Skip to content

Power Apps

Find Matching Values Within Two Collections

Find Matching Values Within Two Collections Input collection: myFruit27a Value Apples Oranges Bananas Kiwis Grapes Pears Input collection: myFruit27b Value A...

Matthew Devaney
Published
Reading time
1 min read

Before you start

Is this guide for you?

Best entry point
Power Apps
Time investment
1 min read

Imported reference from Matthew Devaney's blog for learning purposes. Original: https://www.matthewdevaney.com/powerapps-collections-cookbook/find-matching-values-within-two-collections/. Author: Matthew Devaney.

Find Matching Values Within Two Collections Input collection: myFruit27a Value Apples Oranges Bananas Kiwis Grapes Pears Input collection: myFruit27b Value Apples Plum Oranges Pears Cherries Mangos Output collection: mySolution27a Month Apples Oranges Pears Solution code: //create collections

ClearCollect(myFruit27a,[ "Apples" , "Oranges" , "Bananas" , "Kiwis" , "Grapes" , "Pears" ]); ClearCollect(myFruit27b,[ "Apples" , "Plum" , "Oranges" , "Pears" , "Cherries" , "Mangos" ]); //get matches stored in a Collection

ClearCollect( mySolution27a, ShowColumns( Filter( AddColumns( myFruit27a,

"MatchFound" , If(!IsBlank(LookUp(myFruit27b,Value=myFruit27a[@Value])), true , false ) ), MatchFound= true ), "Value" ) ); Code language: JavaScript ( javascript )

Output value: mySolution27b (in a text string) Apples,Oranges,Pears Solution code: //create collections

ClearCollect(myFruit27a,[ "Apples" , "Oranges" , "Bananas" , "Kiwis" , "Grapes" , "Pears" ]); ClearCollect(myFruit27b,[ "Apples" , "Plum" , "Oranges" , "Pears" , "Cherries" , "Mangos" ]); //get matches stored in a Collection

ClearCollect( mySolution27a, ShowColumns( Filter( AddColumns( myFruit27a,

"MatchFound" , If(!IsBlank(LookUp(myFruit27b,Value=myFruit27a[@Value])), true , false ) ), MatchFound= true ), "Value" ) ); Code language: JavaScript ( javascript )

Share this

Tagged

Collections · Power Apps

Have a Microsoft 365 topic idea?

Share article suggestions, community session ideas, corrections, or real-world scenarios for future nextM365 learning notes.

Suggest a topic

Keep learning Microsoft 365

Explore more practical guides for SharePoint, Power Platform, Copilot Studio, migration, automation, governance, and security.

Continue learning

Next action

What to do next

Browse all tutorials →