Multiple Variables

Kim Burata 1 Reputation point
2021-08-10T01:47:56.52+00:00

Hi,

When using multiple variables in Logic Apps, what's the best practice in doing it? Do I need to Initialise each variable I will use or is there any other way so that it doesn't take to much space on my Designer.

Thanks

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,542 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. MayankBargali-MSFT 70,936 Reputation points Moderator
    2021-08-10T09:18:21.743+00:00

    @Kim Burata You can refer to the create variables for saving document on the usage and how you can use different variable actions. Depending on your requirement you can either initialize individual variable or initialize as an array.

    Assuming the space that you are talking about is the JSON content generated in the code view of your logic app then based on your requirement if defining array variable helps you then you can use it else you can define as individual variable. The suggestion is only define the variable that are used later in your workflow else the unused variable that are define as part of action will still be treated as individual action in your pricing.
    As logic app is charged based on the number of actions for consumption plan and if you initialize different variable (i.e. action) and set the value later on then every action will be counted for the pricing.

    0 comments No comments

  2. Eliot Cole 71 Reputation points
    2025-06-09T17:02:52.7666667+00:00

    I realise that this is an old post, but you can now initialise multiple variables in one action via code view ... check out my LinkedIn post for a VERY basic overview ...

    https://www.linkedin.com/posts/eliot-cole_logicapp-azure-logicapps-activity-7336379488135487490-9FiQ

    What is more ... it will soon be able to initialise multiple variables in one action via the GUI, too ... as an MS employee confirmed in the comments. 😅

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.