cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
omi18
Post Partisan
Post Partisan

Run Time Error for triggering the Flow

Hello,

 

I have a flow that triggers with the click of a button. Which runs the store procedure. In the given screen below I have three different departments with fields. The user may or may not fill in all the details requested. Fields are optional. And I have the same rule (optional fields) set up on the SQL side as well. 

 

When I try to test this flow with random fields completed it works 1-2 times and then starts to throw an error: Invalid parameter. 

 

omi18_0-1624539508415.png

 

Any suggestions? 

 

Thanks,

Omi

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User
Dual Super User

In my experience Power Automate doesn't pass null values in JSON and that is what is used between Power Apps and Flow.  It may still work depending on the order of your optional parameters.  But as I said, I just don't use them because they cause issues.



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

View solution in original post

3 REPLIES 3
Pstork1
Dual Super User
Dual Super User

When calling a flow from Power apps, Power Automate doesn't support optional parameters.  So you have to supply all the parameters.  There are two ways to do this.

1) load the optional parameters with a default value like "null" and then process them in the flow.

2) Pass all the parameters as a single JSON object.  Then parse the object once you are in flow.  Since there is only one parameter, the JSON object, you don't have to worry about optional values.  You can leave them blank in the JSON.



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

Hi @Pstork1 ,

 

Yes, I meant optional as in we are passing null value whichever fields are not filled.  It just happens with this flow. But other flows similar to this are working fine. 

 

Thanks,

Omi

Pstork1
Dual Super User
Dual Super User

In my experience Power Automate doesn't pass null values in JSON and that is what is used between Power Apps and Flow.  It may still work depending on the order of your optional parameters.  But as I said, I just don't use them because they cause issues.



-------------------------------------------------------------------------
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

Announcements
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.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (2,840)