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 / 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,992 Super User 2025 Season 1 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

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 430

#2
timl Profile Picture

timl 318 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard