- Print
- DarkLight
- PDF
Speed up Logic Apps execution with Select Data Action
- Print
- DarkLight
- PDF
Often, when integrating with a backend data serving API, you would need to filter out certain properties and return a subset as a DTO to the consumer. In Logic Apps, the standard way of doing this is to use the foreach action with a combination of the array type variable. Let's say your Logic App calls a user information API which returns a JSON array, as shown below
and you want to pass following JSON to the consumer
You can implement a simple logic app for this as shown below
While this logic app will work, it will start causing performance problems when the number of records that are to be looped through increases, this can be mitigated to a level by enabling For each parallelism
This also is not sufficient. The most efficient way to solve this problem is to use the Select Operation and map the necessary properties as shown below
A sample comparison for the execution time for 1000s records processed through the three approaches is shown in the table below
As it is evident, using Select operation helps speed up simple mapping scenarios for large datasets