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

Display return code of stored procedure in PowerApp

Hello,

 

I have a button in PowerApps which executes a stored procedure and I want to display a message if the stored procedure was executed successfully or not. I have tried doing this by adding an output but I cannot get the result to be displayed in a text field in PowerApps. 

Has anyone tried this successfully?

returncode.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Display return code of stored procedure in PowerApp

Have you tried storing the return code from the Flow in a variable in PowerApps and then binding the textbox to the variable.  As a declarative system PowerApps doesn't normally allow programmatic changes to object properties at runtime.  Usually you have to bind controls to variables and then change the value of the variable.

 YOur run statement should look something like this.

Set(returnvariablename, Flowname.run(input parameters if any))


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

6 REPLIES 6
Dual Super User
Dual Super User

Re: Display return code of stored procedure in PowerApp

Have you tried storing the return code from the Flow in a variable in PowerApps and then binding the textbox to the variable.  As a declarative system PowerApps doesn't normally allow programmatic changes to object properties at runtime.  Usually you have to bind controls to variables and then change the value of the variable.

 YOur run statement should look something like this.

Set(returnvariablename, Flowname.run(input parameters if any))


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

omh
Level: Powered On

Re: Display return code of stored procedure in PowerApp

Hello @Pstork1 ,

 

This is what I did, but the text field displays no value.  

 

Set(datafromflow, ExecuteSP.Run())variable.PNGText field.PNG

Dual Super User
Dual Super User

Re: Display return code of stored procedure in PowerApp

Did you look at the variable value itself using the menu in the designer to make sure that there was a return code?  That will tell you if its just not binding or if there is a problem saving the return code from the stored procedure and returning it to Powerapps.  It might be a Flow or a SQL issue rather than a PowerApps issue.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
omh
Level: Powered On

Re: Display return code of stored procedure in PowerApp

@Pstork1 ,

 

where can I see the return code in designer? I can see the data from the below print screen, but I am not sure if it is the right thing. Thank you.retunrcode.PNG

Dual Super User
Dual Super User

Re: Display return code of stored procedure in PowerApp

Nope, that's the right place.  But if you look down into the Outputs section you will see that your result code is blank.  Double check your stored procedure to make sure its actually returning a result code.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
omh
Level: Powered On

Re: Display return code of stored procedure in PowerApp

Hello @Pstork1 ,

 

I have a return code in my procedure but it still does not return anything.

 

ALTER procedure [dbo].[TESTProc] as
BEGIN
SELECT 8/4
return 1
END

 

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Speakers, submit your sessions now! Call for speakers ends Feb. 10!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (3,315)