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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / FLow SQL Server Execut...
Power Apps
Unanswered

FLow SQL Server Execute Stored Procedure V2 wth 2 parameters errors when returning zero rows.

(0) ShareShare
ReportReport
Posted on by 49

Hello 

 

I have the following flow that executes a SQL Server stored procedure with 2 parameters - 

 

KevBarrie_0-1692095565724.png

 

It works when it returns rows, but flags up an error when no rows are returned.

 

How do I handle that? 

 

Any help would be greatly appreciated.

 

Thanks

 

Kevin

Categories:
I have the same question (0)
  • SanmeshG Profile Picture
    1,947 Moderator on at

    Hi @KevBarrie  ,

     

    You can maybe have two response actions based on how many rows are returned. So a condition to check the length of the array(rows) returned can be added. 

     

    If length > 0 , then you can use the above response in the else part you can use another response , which will return just a message stating no rows matching this condition were returned.

     

    Hope this helps!

     

    Thanks!

  • CU25081109-1 Profile Picture
    49 on at

     

    Hello

     

    I have tried the following -

     

    KevBarrie_0-1692261999184.png

     

    I am checking - 

    length(outputs('Execute_stored_procedure_(V2)')?['body'].ResultSets.Table1) > 0
     
    It works if the stored procedure returns records, however, when it doesn't, still getting the error - 
    "Unable to process template language expressions for action 'Condition' at line '0' and column '0': 'The template language expression 'length(outputs('Execute_stored_procedure_(V2)')?['body'].ResultSets.Table1)' cannot be evaluated because property 'Table1' doesn't exist, available properties are ''. Please see https://aka.ms/logicexpressions for usage details.'."
     
    KevBarrie_1-1692262165331.png

     

    Any ideas what I am doing wrong?

     

    Thanks

     

    Kevin

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 516

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 292

Last 30 days Overall leaderboard