I have a simple Flow in which I try to get data from the sql database. Execute Query works fine, here's the example:
but I cant get any output from that action:
Is there anybody who could show me a working example with the V2 version of that action?
Please post this as a new question. You'll get more responses and others will be able to find the answer more easily later.
Hi, this is an older post but hope someone can help.
@DaveConnors or @Matteo96ITA were you able to get the "insert the Body to the Compose" resolved? I'm having this same issue. TIA
Hi, what does "insert the Body to the Compose" mean and how do I achieve it? I have exactly this issue but I don't know what to put in the first compose.
If the query don't return any results the designer can't render the dynamics contents!
You must digit a query with open parameters for a sure result first.... and second, after you have designed the flow, you can set up the query with correct parameters.
No Compose needed!
Let me know...
BR
Daniele
Hi @openclue ,
Please add a Compose under the Execute a SQL query (v2) action and insert the Body to the Compose.
Then you could add an expression to the Apply to each as screenshot below:
The expression in the Apply to each as below:
outputs('Compose')?['ResultSets']?['Table']
The expression in the Compose 3 as below:
outputs('Compose_2')?['tab']
The flow would run successfully as below:
Best regards,
Alice
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.
To use formal parameters in SQL you need to define the input parameters as part of the SQL Select. Something like the following:
DECLARE @par1 VARCHAR(10); Select * from table where field = @par1
Not sure what SQL data type you are trying to pass as a parameter. It looks like a whole record, which I'm not sure is possible. But the lack of a Declaration of the parameter is what is causing your current issue.
UPDATE:
It seems that the problem was the query, although it was executed correctly.
I changed to a simple query, but I have a problem with the formalParameters:
How should I define it.
@Pstork1 The problem is that I can't access the output of the "Execute a SQL query (V2)" in any way.I tried to use "Parse JSON" or assign an output to a variable of type object. There is nothing out of this action in Dynamic Content.
Based on the screenshots it looks like the table of results you want are in a parameter called Results Sets. Since that is a singular object that contains an array you won't see it directly in an Apply to each. Try using a Parse JSON action to unpack the results you get back from SQL. Then you can process them in a loop if needed.
WarrenBelz
146,660
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional