cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rivside
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.

 

 

3 REPLIES 3
Pstork1
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.

Join me at 365EduCon in Chicago on Sept. 26-30 where I'll be presenting on the Power Platform!

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.

Join me at 365EduCon in Chicago on Sept. 26-30 where I'll be presenting on the Power Platform!

Helpful resources

Announcements
Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

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.

<
Users online (2,700)