Speed up Logic Apps Execution with Filter Array Action
    • Dark
      Light
    • PDF

    Speed up Logic Apps Execution with Filter Array Action

    • Dark
      Light
    • PDF

    Article Summary

    #ServerlessTips - Azure Logic Apps

    Business & Integration Architecture Manager)Often, when integrating with the enterprise APIs, you would need to filter out data served by the API and then return the subset to the consumer. In most cases, the filter can be passed to the API at invocation time, but it is not supported in certain legacy APIs. Let’s look at an efficient pattern to handle this in Logic apps.

    Let’s say your logic app calls a user information API that returns a JSON array.
    download - 2023-07-27T184854.585

    Here, you want to pass only the users from Brazil to the consumer.

    You can implement a simple logic app for this as below.

    download - 2023-07-27T184931.560

    While this logic app works, the performance will degrade when the number of records to be looped increases. The performance issue can be mitigated up to a level by enabling For each parallelism.

    download - 2023-07-27T185031.311

    The most efficient way to solve this problem is to use the Filter array operation as shown below.

    download - 2023-07-27T185256.487

    A sample comparison of the execution time for 1000 records processed through the three approaches is shown in the table below.

    download - 2023-07-27T185330.787

    As evident, the Filter Array operation helps speed up filtering scenarios for large datasets.

    MicrosoftTeams-image 491


    Was this article helpful?