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

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 III
Dual Super User III

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 III
Dual Super User III

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 III
Dual Super User III

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

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,387)