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 / Referencing output par...
Power Apps
Answered

Referencing output parameters from Stored Procedure Flow in PowerApps

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

The new Respond to PowerApps action in Flow looks to answer many prayers, but I can't get it to work with a SQL Server Stored Procedure. I'm trying to follow the Stephen Siciliano blog here.

 

I have a stored proc with several input parameters and 4 output parameters of various types (text, integer, bit). I create a new Flow. All the parameters, whether input or output, appear in the Execute Stored Procedure action. I ignore the output params and set the inputs to Ask in PowerApps dynamic content.

 

Then I add the Respond to PowerApps action. I select 'See more' by the Execute Stored Procedure option under Dynamic Content, but all I get is ReturnCode, not the output parameters. The flow executes ok but ReturnCode has no content.

 

Thinking perhaps the output parameter has to be singular and text, I've tried returning only one text parameter, but still don't see it.

 

I've tried the Request - Response action discussed here. This looks promising - it lists OutputParameters in the dynamic content options. Again the Flow runs but there is no content returned.

 

What am I doing wrong?

Categories:
I have the same question (0)
  • v-micsh-msft Profile Picture
    Microsoft Employee on at

     

    What is the output of the Stored Procedure within Microsoft Flow?

    You should be able to get the procedure results with the following expression under Microsoft Flow:

    body('<Action_name>')?['ResultSets']

    Which you may reference the detailed value by adding:

    body('<Action_name>')?['ResultSets']?['FieldName']

    Regards,

    Michael

     

  • JonathanGibbs Profile Picture
    313 on at

    Thanks Michael

    Here's a sample flow. The Stored Procedure 'kmJunk' takes one integer input parameter and returns a single integer output parameter with the value 55:

    Capture.PNG

     

    The flow runs successfully and here's the result:

    Capture.PNG

     

    Surely this should be showing an output parameter (pOutput, with a value of 55)? The Stored Procedure is being fired and working correctly, and if I run it in SSMS I get some expected output parameter.

    Not sure where to start with this..!

    thanks

    Jonathan

     

  • Verified answer
    jonathanO Profile Picture
    98 on at

    Just in case anyone else sees this, Flow cannot return OUTPUT parameters from a stored procedure per the documentation:

     

    https://docs.microsoft.com/en-us/connectors/sql/

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @v-micsh-msftHi Michael. Your response here is very helpful with learning how to access the values within the ResultsSet. Is there any documentation or tutorials that elaborates deeper on how to do this?

     

    Thanks!

    Sean

  • v-micsh-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

     

    Sure. Microsoft Flow is built on top of Azure Logic Apps, so they would all work with the same language:

    Workflow definition Language schema

     

    Best regards,

  • johnnie Profile Picture
    on at

    Within the stored procedure, define the output parameter.... 

    flow.png

    Within the Flow, define a Respond to a PowerApp or flow step.  In my case the Output parameter is the second INT that I am returning...

    flow2.png

    Quick TIP.  If the data type is an INT, you must cast it to an INT via a formula, such as ...

     

    int(body('ExecuteStoredProcedureV2')?['outputparameters/NewRootChildID'])

     

    Finally, within the PowerApp, capture the return record from the call to the Flow, and reference the output value from the Stored Procedure.

     

    UpdateContext({ReturnValuesVar: CopyPlantHierarchyTree.Run(ThisItem.ChildId, ThisItem.ParentId)});
    If (ReturnValuesVar.returncodevalue = 0,
     UpdateContext({OutputValue: ReturnValuesVar.newrootchildid});
    ...

     

    Here is the output from the flow after it was called from PowerApps...

    flow3.png

  • MarrinerDev Profile Picture
    on at

    Note that in this documentation, it only refers to on-premises SQL Server having this limitation. As per Johnnie and Michael's reply, it does work for Azure SQL.

     

    3) When invoking a Stored Procedure on an on-premises SQL Server, we have the following limitations:

    • Output values for OUTPUT parameters are not returned. You can still specify input values for OUTPUT parameters.

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 416 Most Valuable Professional

#2
11manish Profile Picture

11manish 205 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard