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 Apps / Stored Proc returns ? ...
Power Apps
Answered

Stored Proc returns ? for Result Set from SQL Server

(0) ShareShare
ReportReport
Posted on by 10
I have a Power App with two Premium SQL Connectors in it:
  • Azure SQL Database
  • SQL Server 2019 Database, running on an Azure VM
I set both up for stored procedures, passing in parameters, and allowing data to be shown in galleries.
 
I am using buttons to call the procedures and store the returned data in Collections, using the ClearCollect command.
 
The first (Azure SQL Database) works just fine. I can see the data in Collections. It gives me a little, clickable table icon under ResultSets, and I can manifest the collection in a gallery nested inside another gallery.
 
The second (calling SQL Server based on VM, using an On Premises gateway) does not work. Under Variables > Collections it says "Table: 1 rows" but when rClick to view the table, the ResultSet for the collection shows a ? question mark instead of a clickable table icon.
 
How do I get it to show data?
 
FYI, when I set it up, it allowed me to see a list of the stored procedures in the database, and when I code a button to call it, the parameters for the stored procedure show in the prompt. But when I click the button, passing in a valid parameter (which works when running from SSMS), only the ? is returned in the ResultSet.
 
It should look like this:
 
 
But instead it looks like this:
 
I have the same question (0)
  • Suggested answer
    SaiRT14 Profile Picture
    1,990 Super User 2025 Season 2 on at
    Here are my thoughts:
     
    Power Apps expects stored procedures to return a single result set for data-binding purposes. Ensure:
    Check the Data Gateway Configuration 
    Verify Data Source Configuration:
    When calling the stored procedure, ensure that the result set is captured properly into the collection.
    ClearCollect(
        colResults,
        '[dbo].[GetData]'(
            Parameter: 123 // Replace with your parameter value
        )
    );
  • Verified answer
    MB-23070938-0 Profile Picture
    48 on at
    You need to specify each column and their data type to get the table to show up.
     
     
     
    Set(
        <MyUntypedObject>, // pull results into variable
        <datasourceName>.<StoredprocedureName>( 
          { <paramName1>: "someString" }
        ).ResultSets
    );
    Set(
        table1, // put Table1 into table1
        <MyUntypedObject>.Table1
    );
    Set(
        TypedTable,
        ForAll(
            table1, // extract JSON from table1
            {
                BookID: Value(ThisRecord.BookID),
                BookName: Text(ThisRecord.BookName)
            }
        )
    );
     
     
     
    Best
    M

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard