cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

How to invoke stored procedure with NULL

Hi,

 

I have an issue with passing NULL value to stored procedure. The procedure is a simple INSERT INTO some table. When I run the same procedure from Query editor on database with NULL parameters it works fine. When I do it from Flow, I receive error message that parameter was not supplied:

 

image.png

Same Flow with different values (for example @StartQ = 5) works fine. Is there any method to pass a NULL values to stored procedure (I want to have NULL in database table).

 

Any idea?

5 REPLIES 5
Dual Super User
Dual Super User

Re: How to invoke stored procedure with NULL

Hi @Anonymous 

 

Can you please share a screenshot of the flow? Are you passing the null value through an expression or just writing "null"? You might want to try passing through the null expression if not already. Please see the screenshot below: ww.png

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Anonymous
Not applicable

Re: How to invoke stored procedure with NULL

Hi,

 

I'm using an expression. Here is my code:

 @{if(equals(9999,triggerBody()['Executestoredprocedure_FinishQ']),null,triggerBody()['Executestoredprocedure_FinishQ'])}

This code generates described error if Executestoredprocedure_FinishQ equals 9999, and works fine in other cases 😞

Dual Super User
Dual Super User

Re: How to invoke stored procedure with NULL

Hi @Anonymous 

 

I would like to see where you are using that expression and I am hoping that you are using the null value from expression editor instead of typing null (as the former would take a null value and the latter would be a string "null")

 

Hope this Helps!

Anonymous
Not applicable

Re: How to invoke stored procedure with NULL

Hi,

 

I have some trouble with uproading screenshot. Please check the link:

https://drive.google.com/open?id=1wM7W_2KP9ka0bS9hP0jlTpjFBe8Kf9Dt

 

Expession was generated by clicking in expression editor 🙂

dixus69
New Member

Re: How to invoke stored procedure with NULL

Is there really no solution passing null into an sql query using an expression??

The only workaround isn't working in all cases: Use a variable and condition. This is ugly and doesn't work with parallized iterations.

Kind regards,
Holger

Helpful resources

Announcements
Did you attend MBAS? Claim your badge

Attending MBAS? Claim your badge

Whether you’ve streamed the digital event live, or you're watching on-demand, claim your attendee badge to sport on your profile.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Users online (5,117)