Is there any way that I can assign my SQL SELECT statement result to a variable so that I can use it in further steps?
In the same way we declare variables in SQL and assign values to it.
What can be the reason that step does not show up on the list at all!?
@AmirZolf Can you scroll up and down in the dynamic window and see if its there. I only said click that one as I didnt see you had 2.
Well, that is my problem. The body for that query does not populate.
It is for the other one.
Hi @AmirZolf
body has what you need (its the results) If you click on body and add it to the compose. Then hover your mouse over the added property (dont click it) you wil see something like
body('Execute_a_SQL_query_(V2)')
then you access your data (and I have no idea what yours looks like) via that.
Essentially its a JSON Array. Which means you normally access it with an Apply to each, where you would put the body, in the Input.
That would loop through your results.
As it loops you would have access to the columns and their values based on the iteration of the loop as it goes row to row.
I hope that makes sense.
If I have answered your question, it would be helpful if you Mark my response as an Answer/Resolved and maybe even a thumbs up.
Cheers
If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
Thank You
Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
https://gernaeysoftware.com
LinkedIn: https://www.linkedin.com/in/michaelgernaey
There are other Dynamic contents there, but not this one!
You dont need too. Any action that you perform, the output is available to the rest of the flow. You just need to know what dynamic property to access.
The output of a SQL Query would be an Outputs or Body which is going to be an Array of your Results
If you show your flow, and if you add a Compose right after your Query Action. Then just click in the box, let the Dynamic Properties windows popup. Scroll to the section that is for the Output of your SQL Action and you will see. Please feel free to share the image if you are having issues finding it.
Please mark this as Resolved and maybe also a Thumbs Ups.
Cheers
If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
Thank You
Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
https://gernaeysoftware.com
LinkedIn: https://www.linkedin.com/in/michaelgernaey
WarrenBelz
146,771
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,091
Most Valuable Professional