Skip to main content

Command Palette

Search for a command to run...

How to pass null values to stored procedures from PowerApps

Updated
1 min read

Power apps uses Flow/Automate to call connect to sql and execute a stored procedure. But flow will not allow you to pass Blank/null value from power app.

As a fallback what we can do is, pass a know default value to the flow and in flow check for the known default value and convert it to null in the Execute sp action.

if(lessOrEquals(triggerBody()['Executestoredprocedure(V2)_FieldData'],0),null,triggerBody()['Executestoredprocedure(V2)_FieldData'])

If the current value in the passed value is 0 or less, null will be passed to the db else the original value.

From power app , you can initiate a flow call by the below code

SampleFlow.Run(If(IsBlankOrError(cmbUser.Selected.ID),-1,cmbUser.Selected.ID),...)

If the value of cmbUser is null or invalid, -1 will be used when calling the flow. (known default value)

More from this blog

Fix, Build, Automate

17 posts

Straightforward solutions for modern tech problems