cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Add Condition - Null SQL Query Results

I am building condition where if my SQL Query Results are blank then I want it to post a Message to Microsoft teams. If the query is not null then it will create a few files to be dropped to an FTP and a Sharepoint site. When the Query Is empty I need a message posted to Microsoft Teams. When I input a query that produces blank results. I get a failure in the flow. Can anyone shed some light on how I can best do thisflow failure 1.JPGflow Success 1.JPGflow failure 2.JPGflow failure 3.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
v-bacao-msft
Community Support
Community Support

Hi @Anonymous,

 

Could you provide detailed configuration of your Table?

I noticed that although you are input a query that produces blank results, the output of Query Results still contains Values, so the result of Condition is True.

flow failure 2.JPG

But because there is no matching value to create CSV table, it leads to such an error.

I think that in your Condition, you may have to specify which fields have no query results, so that it could be more accurate.

Please try to specify the judgment in the Condition to the column level. For example, if the column xxx query results are empty, the result will be False.

 

Best Regards,

Barry

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

View solution in original post

3 REPLIES 3
v-bacao-msft
Community Support
Community Support

Hi @Anonymous,

 

Could you provide detailed configuration of your Table?

I noticed that although you are input a query that produces blank results, the output of Query Results still contains Values, so the result of Condition is True.

flow failure 2.JPG

But because there is no matching value to create CSV table, it leads to such an error.

I think that in your Condition, you may have to specify which fields have no query results, so that it could be more accurate.

Please try to specify the judgment in the Condition to the column level. For example, if the column xxx query results are empty, the result will be False.

 

Best Regards,

Barry

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

Hey, @Anonymous!

Thank you for posting on the Flow Community Forum! It appears as though @v-bacao-msft would like some more information in order to further assist you properly with your issue. Please share any additional information that was requested in order to decrease the amount of time that it will take for you to be assisted!

Thank you for being an active member of the Flow Community!

-Gabriel
Flow Community Manager

- Gabriel
Community Manager
Power Automate | Power Virtual Agents
Super User Program Manager



Can you explain how to "specify the judgment in the Condition to the column level. For example, if the column xxx query results are empty, the result will be False."

 

I have a query that produces no results like this example, but I can't figure out how to check whether the column "title" is empty.  There is no option in the condition to check whether a column of the result set is empty.  I am only given the option to use as an input to the condition "ResultSets" or "Query Results".  

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (1,406)