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 Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (4,373)