Filter A Collection With AND Condition
Filter A Collection With AND Condition Input collection: myTrucks40 Year Make Model 2020 Ford F150 2018 Chevy Silverado 2019 Ford F150 2020 Chevy Avalanche 2...
- 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/filter-a-collection-with-and-condition/. Author: Matthew Devaney.
Filter A Collection With AND Condition Input collection: myTrucks40 Year Make Model 2020 Ford F150 2018 Chevy Silverado 2019 Ford F150 2020 Chevy Avalanche 2017 Chevy Silverado 2016 GM Yukon
Output collection: mySolution40 (filter on greater than or equal to year ‘2018’ AND less than or equal to year ‘2020’) Year Make Model 2020 Ford F150 2018 Chevy Silverado 2019 Ford F150 2020 Chevy Avalanche Solution code: //Create a collection
ClearCollect(myTrucks40, { Year : 2020 , Make : "Ford" , Model : "F150" }, { Year : 2018 , Make : "Chevy" , Model : "Silverado" }, { Year : 2019 , Make : "Ford" , Model : "F150" }, { Year : 2020 , Make : "Chevy" , Model : "Avalanche" }, { Year : 2017 , Make : "Chevy" , Model : "Silverado" }, { Year : 2016 , Make : "GM" , Model : "Yukon" } ); //Filter collection code
ClearCollect( mySolution40, Filter(myTrucks40,Year>= 2018 ,Year<= 2020 ) ); Code language: JavaScript ( javascript )
Tagged
Collections · Power Apps
Have a Microsoft 365 topic idea?
Share article suggestions, community session ideas, corrections, or real-world scenarios for future nxtM365 learning notes.
Keep learning Microsoft 365
Explore more practical guides for SharePoint, Power Platform, Copilot Studio, migration, automation, governance, and security.
Continue learning
Related tutorials
Related questions
Related comparisons
Next action