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 / Issue returning a blan...
Power Apps
Answered

Issue returning a blank result from a stored procedure (using a flow) to powerapp

(0) ShareShare
ReportReport
Posted on by 68

Hi, I am calling a stored procedure from powerapp and storing the result set in a collection. This works fine so long as data is returned from the stored procedure. However I am having issues when no data is returned.

I trigger the stored procedure using and store the results using

ClearCollect(queryResults,GetSQLData.Run(inpSearch.Text));


Within the flow after executing the stored procedure I check to see if the result set is empty. If it is not empty a response action is triggered to return the data using a schema generated from the the sample returned from the execute stored procedure step. This all works as expected.

If the result set is empty another response is triggered, Ultimately I need to do here is return the blank array of data.  I have used the same schema but removed the required fields elements. However when I call this from powerapp using a search that I know will generate no results I get a JSON parse error expected array received object.

Any help appreciated 

Categories:
I have the same question (0)
  • Verified answer
    ianselbyuk Profile Picture
    68 on at

    I have now resolved this. Posting my solution for anyone else who may have a similar issue. The issue was linked to the JSON schema and also the body of the response for returning the empty dataset. In my case I needed to update the body from

    body('Execute_stored_procedure_(v2)')['ResultSets']['Table1']

    which was used when results were returned to

    body('Execute_stored_procedure_(v2)')['ResultSets']

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 396 Most Valuable Professional

#2
11manish Profile Picture

11manish 134 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 101 Super User 2026 Season 2

Last 30 days Overall leaderboard