web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How do I specify an op...
Power Automate
Unanswered

How do I specify an optional parameter for a Stored Procedure?

(0) ShareShare
ReportReport
Posted on by 894

I am trying to build a flow to run an SQL StoredProcedure that will accept NULL value parameters.

Unfortunately, PowerApps won't.

When I try to test the flow, it tells me these fields require a value.

Wrong! They don't.

Putting values in them will, in this case, give me the wrong results.

How can I specify that these fields are optional.

I have specified each parameter with an Initialize Variable action.

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    The action to invoke a stored procedure will provide fields for all the parameters whether they are optional or not.  For the optional parameters you can just leave them blank and the stored procedure will be invoked with a null value for that parameter, which will trigger it to use the default you have specified in the stored procedure.

     

    I suspect what you mean is that the stored procedure is designed to allow null values on required parameters.  For that scenario try feeding in an actual null value using the null expression entered in the expression tab of the dynamic content box.

  • Justinrr07 Profile Picture
    44 on at

    @Pstork1 can you please provide an example of your 2nd solution suggestion? I believe that is what I need. My stored procedure allows nulls. I just don't know how to get it to work in Flow as an "optional" parameter.

     

    I also can't figure out why Flow is requiring EmployeeId twice...

     

    Capture.JPGCapture1.JPG

  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    Flow doesn't understand the concept of an optional parameter.  But you can set the parameter to be null when invoking the stored procedure and if the stored procedure allows null parameters it will work fine.

  • Justinrr07 Profile Picture
    44 on at

    @Pstork1 thank you for the quick reply. How do I set the parameter to be null when invoking from Flow? Ultimately I will call the Flow from PowerApps with the parameters provided from PowerApps.

  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    Use the expressions tab and input null into the field or just leave it blank.

     

    image.png

  • Justinrr07 Profile Picture
    44 on at

    @Pstork1 Is it possible to use an expression to create a case statement? For example, if the parameter is not null from power apps, use the value power apps is providing. Otherwise, use null.

  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    YOu could try coalesce(), but you can't actually pass a null value from Power Apps to Power Automate.  You'll have to pass an empty string and work off that.

     

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.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard