Showing results for 
Search instead for 
Did you mean: 
New Member

Variables in Flow

Is it possible to declare variables with any function or code in Flow manually and reference to them later in PowerApps?


The only known possibility for me is to use the Ask in PowerApps function. This is very confusing if you are using more as 100 in one single flow. Additionaly you need to keep the order from the first to the last variable.



Dual Super User
Dual Super User

If you are talking about declaring variables when calling a flow from Power apps then take a look at the Power Apps V2 trigger.  With that trigger you can create all the parameters in the trigger and won't need to use Ask in Power Apps.  However you will still need to add them in the order that they are declared.  When sending a large number of parameters to a flow I normally add them all to a record or a collection in Power Apps and then send that as a single string to the flow using the JSON() function.  That string can then be parsed in the flow using the Parse Json action to get the individual parameters.

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Unfortunately the v2 trigger is limited to 19 variables only.

There is some workaround with JSON, but I think with the standard trigger and Ask in PowerApps it's still faster.


Thank you.

The problem is that when you get that many parameters, with either trigger, its almost unusable in the Power App.  As you mentioned the parameters need to be entered in order and the intellisense prompting in the Power App gets cut off after the first couple parameters.  I've seen lots of issue with errors because the wrong values are in the wrong place in the parameter list.  Send the values as a JSON string gives all the values a key name so the order no longer matters.  You can change the layout of the record/collection at any time and as long as you update the schema in the flow it will continue to work.  If you have that many parameters I really suggest you look into sending them as JSON. 


Also, the V2 trigger is no slower than the V1 trigger if the parameters are correct.  Its just a difference in the way the parameters are defined.  The V2 version is much easier to maintain.

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (1,802)