I have two "SQL Server - Execute a Query Actions" in the same flow. The first one initially gave me Dynamic content, but the second one refuses to. More troubling is that the first action does not show dynamic content any more (the dynamic content I added originally is still there), so it seems something is wrong with the flow/connector.
In particular I'm trying to get a row count from a table.
I've tried two different techniques, but neither work.
1st attempt is a simple count row e.g.
SELECT COUNT(*) AS TOTALROWS FROM TableName]
The second is:
DECLARE @rc INT
SET @rc = (SELECT COUNT(*) AS TOTALROWS FROM TableName)
PRINT @rc
They both execute, but neither yield any dynamic content.
Solved! Go to Solution.
Thansk for the reply. I solved the problem with some clues from the dev team after I sent them a Fiddler trace.
This likely applies to other actions that are using dynamic content or produce an array when there is only one line returned.
The issues are twofold.
Hi @MarkAggar_MSFT,
What’s your current situation? Are you still having the issue?
When testing it on my side, I can get dynamic contents from both the two actions “Execute a SQL query”.
A screenshot likes below.
Could you please recreate the flow from blank to see if it will work?
Please also make sure the queries you are using are correct.
If you are still having the issue, please feel free post back.
Best regards,
Mabel Mao
Thansk for the reply. I solved the problem with some clues from the dev team after I sent them a Fiddler trace.
This likely applies to other actions that are using dynamic content or produce an array when there is only one line returned.
The issues are twofold.
I am having the same problem. I don't understand what is meant by "The trick is to hardcode all of the query, get the dynamic content into your subsequent actions and then replace the hardcoded values in the SQL query with dynamic content from the previous actions." Where does the hardcoding take place? How do I do this?
For instance, if you had a query that was a simple
SELECT * FROM TABLENAME
WHERE COLNAME = '[Flow Dynamic Content]'
you should temporarily hardcode the [Flow Dynamic Content] to a regular string
SELECT * FROM TABLENAME
WHERE COLNAME = 'String'
It can literally be anything, just needs to be some text or number.
Then you'll be able to see the COLNAME column as dynamic content in subsequent flow actions, etc.
Once you've added those Flow dynamic content(s) into your subsequent actions, go back to your SQL (or whatever) action and put the Flow dynamic content variables back in where they were originally.
Experiencing a similar issue too, specifically related to Ask in Power Apps with SQL Server connection. I tried Ask in Power Apps within the 'Execute a SQL query (V2)' query where ID = 'Ask in Power Apps'
but no new steps return dynamic content from SQL.
I even initialized a variable, setting it as the dynamic value I pass through Power Apps, then use the int Variable instead of 'Ask in Power Apps' within the query to return the Result Set of the query.
Still nothing.
Dynamic Content only returns in subsequent steps if I hardcode the query. Is there another solution?
Check out new user group experience and if you are a leader please create your group
See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.
User | Count |
---|---|
53 | |
41 | |
39 | |
38 | |
36 |
User | Count |
---|---|
77 | |
72 | |
71 | |
54 | |
49 |