web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Flow failing when SQL ...
Power Automate
Unanswered

Flow failing when SQL query returns empty set

(0) ShareShare
ReportReport
Posted on by 17

I've created a flow that fails when the SQL query returns an empty set.  I've found lots of mentions of similar issues, but none that include a solution.
This is a very simple flow - I'm searching a database for employees with a given start date, and sending an email to each of them.  Often, though, there are no employees with a particular start date, and the flow fails.

DBean_0-1611256180145.png

 

I've tried this:

 

DBean_3-1611256817968.png

 

And that doesn't work:

DBean_4-1611256891983.png

 

I found mentions of an "Empty" function, but when I try using that instead of "Null", I get this:

DBean_2-1611256667801.png

Any thoughts?  Thanks in advance!

 

 

Categories:
I have the same question (0)
  • Verified answer
    Paulie78 Profile Picture
    8,422 Moderator on at

    The SQL connector returns a bunch of outputs, I would suggest you use something like:

    not(empty(outputs('Execute_a_SQL_query_(V2)')?['body/resultsets/Table1']))

    On the left side of your condition and the true expression on the right side. Make sure you use the expression true, not just type true in, like this:

    EmptySQL.jpg

  • DBean Profile Picture
    17 on at

    @Paulie78 That did the trick - thanks!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard