Showing results for 
Search instead for 
Did you mean: 
Level: Powered On

Issue with Execute SQL query with formal paramter in Flow



I am currently having an issue with Executing a SQL query with parameter in Flow.

I have a PowerApp that calls a flow and give  certain paramaters to the Flow.

The goal of the Flow is that it Executes A query an give the result back to PowerApps.


I created a flow that takes input from Power Apps.

After that I use a Compose to transform the inputvariable (formatting input date to 'yyy-MM-dd')

After that I want to execute a SQL query with the output of the Compose as a formal parameter.

However it seems that he is not assigning any value to the formal paramater.


He is running succesfull, but does not return a value for @datum. He seems not store the date in that variable (it is not a connection issue since he do return the BD_opbrengst value).

Does anyone have an idea what I am doing wrong? Changing the datatype of the variable does not help either.


See below the ouput that I get when I test the flow:


declare @datum as char(10); select @datum as datum, BD_opbrengst from dbo.opbrengsten
  "datum": "2011-08-15"
Query Results
  "OutputParameters": {},
  "ResultSets": {
    "Table1": [
        "datum": null,
        "BD_opbrengst": 5000


Community Support Team
Community Support Team

Re: Issue with Execute SQL query with formal paramter in Flow

Hi @PowerappBuilder ,


Could you please share a screenshot of the configuration your flow?

Could you please explain more details about your issue?


Please share more details so we would try to provide a proper workaround for you.


Best regards,

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Level: Powered On

Re: Issue with Execute SQL query with formal paramter in Flow

Hi Alice,


Below the flow I am currently testing.

So I ask from PowerApps a variable, put that in Compose to transform that variable, and then assign the output of   compose as Formal Paramater to Excecute SQL query.

In picture you see that I give that value to "datum".

Whener I execute the query Select @datum he gives as ouput NULL.

Even when I just initialize a variable in Flow and give it a default value and give it then as a formal paramater to Execute a Sql query, he gives ouptut NULL.  So  whatever I try I do not get a value for the formal parameter returned by the query . He seems not able to assign the value to the formal paramater.

He do return the value from BD_opbrensgt (so there is no connectivity issue).





Helpful resources


Power Platform Online Conference

Speakers, submit your sessions now! Call for speakers ends Feb. 10!


New & Improved Power Automate Community Cookbook

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


Power Automate Community User Group Member Badge

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


Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!


Microsoft Learn

Learn how to build the business apps that you need.


Power Platform World Tour

Find out where you can attend!


Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (4,677)