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 / Execute a SQL Query an...
Power Automate
Answered

Execute a SQL Query and Catch a Empty Return

(1) ShareShare
ReportReport
Posted on by 114

i am running a very simple query. Say "Select * from junk" using the Execute a SQL query Action.  I if data is in the table everything works fine.  My collection is populated in Powerapps.  The problem is when the table is empty and returns nothing.  I need a way to know in powers that it returned nothing.  i need help on catching or responding with text or empty table so i can countrows to determine it is empty to continue with my next step on nothing found with Query.

 

Please help.  Dragging my brain for a day now.

 

Office 365. 

Categories:
I have the same question (0)
  • manuelstgomes Profile Picture
    6,625 on at

    Hi @wsalling 

     

    I'm not an expert in PowerApps but I think you can try to catch that on the "onVisible" of the page and count if the source has or not values. If not you can do a "Navigate" to the section you want.

     

    But the good folks over at the PowerApps community can probably help you better than me:

    https://powerusers.microsoft.com/t5/Power-Apps-Community/ct-p/PowerApps1

     

    Hope this helps you

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
    ​
    Cheers
    Manuel

  • Verified answer
    ChristianAbata Profile Picture
    8,951 Most Valuable Professional on at

    Hi @wsalling  you can manage empty consults like this.

    resultset.PNG

    So the compose gives you a true value, and the if is true you can do somenthing.

    empty(body('Execute_a_SQL_query_(V2)')?['resultsets'])
  • wsalling Profile Picture
    114 on at

    Thank you

  • ChristianAbata Profile Picture
    8,951 Most Valuable Professional on at

    @wsalling  it was a pleasure, please don't forget to mark the answer as a solution.

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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard