Announcements
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.
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.
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.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
WarrenBelz 324 Most Valuable Professional
11manish 193
Valantis 138