Can we filter the array/collections using Power Automate or LogicApps?
Ever came across a situation where from a list of records/objects, you only want to get few based on some criteria in Power Automate Flow? Most of us have gone through that but with the loop approach. In this blog, we will talk about the efficient way to filter the records without loop.
To filter the data from the collection, one way is to loop through the collection and use the “If” to check the condition and get the required data. But what if you have more records in the collection and looping through each is very time-consuming. Right?
Let’s explore other way to do the same thing:
We have created a manually triggered flow and an array.
Below is the output of the above filter criteria.
In the “Filter Array”, to add multiple conditions, navigate to the advance editor.
An expression related to gender will be displayed.
Now, you can add new condition by using the Operators “AND”, “OR”.
We will be using the AND operation to get all the records from the array whose “Gender” is “Male”, and whose “Age” is greater than “20”.
Below is the output of the above condition.
With this approach, without loop control we can get the required results using one single step which saves the time the Flow takes.
Also, when connecting to any backend like Dataverse, instead of multiple Fetch on the same Table based on condition, we can use just one fetch, get all data and then use the Filter data operation to only get the required results.
So this is how we can Filter the array/collection using Power Automate or LogicApps. Hope this helps!
ATM Inspection PowerApp to ease ATM inspection and report generation process.
https://www.inkeysolutions.com/microsoft-power-platform/power-app/atm-inspection
Insert data into Many-to-Many relationship in Dynamics CRM very easily & quickly, using the Drag and drop listbox.
http://www.inkeysolutions.com/what-we-do/dynamicscrmaddons/drag-and-drop-listbox
Comply your Lead, Contact, and User entities of D365 CRM with GDPR compliance using the GDPR add-on.
https://www.inkeysolutions.com/microsoft-dynamics-365/dynamicscrmaddons/gdpr
Create a personal / system view in Dynamics CRM with all the fields on the form/s which you select for a particular entity using the View Creator.
http://www.inkeysolutions.com/what-we-do/dynamicscrmaddons/view-creator
© All Rights Reserved. Inkey IT Solutions Pvt. Ltd. 2024
in case if the people query from dataverse this is how they have to filter. equals(item()?[‘new_sex’]?[0],’Male’) ( just putting here as it may help others)
Thank you, Viswanath!