cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LynnCaveny
Level: Powered On

Stored Procedure Support in PowerApps

PowerApps doesn’t seem to support the execution of On-Premise SQL Server stored procedures.

 

So, is it possible to interface with an On-Premise web service that connects to the SQL Server and executes the stored procedure, which in turn, returns data?

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support Team
Community Support Team

Re: Stored Procedure Support in PowerApps

Hi @LynnCaveny,

 

You may take a look at the custom connector:

Register and use custom connectors in PowerApps

 

Further, You could take a try to add a flow to execute stored procedure (supports SQL Server stored procedure with on-premise gateway), as currenlty there is no method to get the flow results to the App in PowerApps, you need to connect to the corresponding data directly to check the results in PowerApps.

Start a flow in an app

 

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

LynnCaveny
Level: Powered On

Re: Stored Procedure Support in PowerApps

So far we haven't gotten PowerApps approved for our company, but have you tried using a table function.  It's not as good as a stored procedure, but you can pass in parameters and it will return a table.   Here is an example I've used in PowerBI, but I'm thinking it would work int PowerApps:

 

          SELECT *
          FROM POWERBI.TF_PB00002_Open_Activity_List('All')

 

PowerBI looks at it as just another DirectQuery and a table function can contain most of the logic you would normally put in a stored procedure.

View solution in original post

9 REPLIES 9
Community Support Team
Community Support Team

Re: Stored Procedure Support in PowerApps

Hi @LynnCaveny,

 

You may take a look at the custom connector:

Register and use custom connectors in PowerApps

 

Further, You could take a try to add a flow to execute stored procedure (supports SQL Server stored procedure with on-premise gateway), as currenlty there is no method to get the flow results to the App in PowerApps, you need to connect to the corresponding data directly to check the results in PowerApps.

Start a flow in an app

 

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

SqueakerJG
Level: Power Up

Re: Stored Procedure Support in PowerApps

Is this still the case?  No responses (output paramaters or result sets) supported from stored procedures through the gateway connector?

KML
Level: Powered On

Re: Stored Procedure Support in PowerApps

Bump up - any Idea raised for this? I would like to have the outcome of procedure (table) in powerapps directly. (in collection)

RussellGove
Level 10

Re: Stored Procedure Support in PowerApps

Is there a uservoice or something shere we can vote on this? This is a major drawback!

SqueakerJG
Level: Power Up

Re: Stored Procedure Support in PowerApps

we ended up redesigning our solution to not depend on the response in one app, and another we moved the database to AzureSQL which does allow responses from the stored procedures.

RussellGove
Level 10

Re: Stored Procedure Support in PowerApps

Ah, so I can call the sproc, i just dont get a ressponse? I didn't get that in the conversation above, or the docs.

 

SqueakerJG
Level: Power Up

Re: Stored Procedure Support in PowerApps

correct. You can call it, but you can't return a data-set or get a response value.
LynnCaveny
Level: Powered On

Re: Stored Procedure Support in PowerApps

So far we haven't gotten PowerApps approved for our company, but have you tried using a table function.  It's not as good as a stored procedure, but you can pass in parameters and it will return a table.   Here is an example I've used in PowerBI, but I'm thinking it would work int PowerApps:

 

          SELECT *
          FROM POWERBI.TF_PB00002_Open_Activity_List('All')

 

PowerBI looks at it as just another DirectQuery and a table function can contain most of the logic you would normally put in a stored procedure.

View solution in original post

andrew121
Level: Powered On

Re: Stored Procedure Support in PowerApps

You can get a response value, true or false, but getting the returned data seems impossible. The flow runs from a button in the app and if you examine the flow afterwards, you can see all the returned data in the flow in resultsets table1. But I can't figure how to retrieve it to the app itself. Very frustrating, Microsoft could do so much better.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,760)