Announcements
Hello - trying to initiate a .Run flow to pass a bunch of variables ( based on selections to a flow ) but it seems if the string value is left blank or no selection i am getting an error when it i try to initiate - the default selection on the canvas app is "" so I am not sure if there is a different way I should be saving these?
The problem is that you can't pass a null parameter to the flow. So what I normally do instead is put the parameters into a variable as a record and then use the JSON() function to pass that to flow as a single parameter. Then in the flow you can parse the JSON to get the individual parameters. That way you can pass a parameter even if its null.
Hello -
Are you able to help me understand with an example ? Rather new to PowerApps / Flow workings - currently the vars are generated OnSelect as below? Then Submitted with a different button shown above with the .Run
Set(B211IN,B211INBOUND.Selected.Railcar); Set(B211OUT,B211OUTBOUND.Selected.Railcar); Set(B2171IN,B2171INBOUND.Selected.Railcar); Set(B2171OUT,B2171OUTBOUND.Selected.Railcar); Set(B2172IN,B2172INBOUND.Selected.Railcar); Set(B2172OUT,B2172OUTBOUND.Selected.Railcar);
@Anonymous
Please consider changing your Formula to the following:
'374RailFlow'.Run(B211IN.Selected.Railcar, B211OUT.Selected.Railcar, B217IN.Selected.Railcar, B2171OUT.Selected.Railcar, B2172IN.Selected.Railcar, B2172OUT.Selected.Railcar)
You were passing the controls to your flow, not the values.
I hope this is helpful for you.
Here's some sample code. You will also have to change the flow to only ask for one parameter and then Parse the JSON. You can remove all the existing parameters by dropping the trigger and re-adding it.
Set(JSONdata,{B211IN: B211INBOUND.Selected.Railcar, B211OUT: B211OUTBOUND.Selected.Railcar, other fields}); flow.run(JSON(JSONdata, JSONFormat.Compact));
Forgot to mention in my last post...I do agree with @Pstork1 in the use of passing all information as a JSON parameter rather than individual arguments as this will let your app and flow be MUCH more flexible. However, if you are going to pass JSON instead of params, you will need to redo your flow to accommodate that.
If you do so, then the formula mentioned will be successful. My only 2 cents on it would be to avoid a variable for this as it is just an app clutter variable.
'374RailFlow'.Run( JSON( {B211IN: B211INBOUND.Selected.Railcar, B211OUT: B211OUTBOUND.Selected.Railcar, other fields}, JSONFormat.Compact ) );
I agree with @RandyHayes about the variable. Its just easier to explain the change since he was already using a variable. It also makes it easier to check the values being passed when troubleshooting since you can examine the variable values in Power Apps, but not as easy when embedding the actual values.
So it looks like i am currently getting an error right now
'374RailFlow'.Run
Got 1 argument, expected 6
As I mentioned - "However, if you are going to pass JSON instead of params, you will need to redo your flow to accommodate that."
You need to rebuild your flow to have only one JSON parameter. Then in your Flow, you need to parse the JSON into values.
As I mentioned to get rid of the additional arguments you need to remove the existing trigger and re-add it. Then you can add a new Ask In Power Apps dynamic content entry to get the JSON parameter.
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 2026 Super Users!
Congratulations to our 2025 community superstars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Vish WR 846
Valantis 532
Haque 410