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 Apps
Unanswered

Stored procedure

(0) ShareShare
ReportReport
Posted on by

Hi, in an app I have to launch a stored procedure on sql, passing two parameters. How can I return the data processed by the stored procedure to a table or a gallery? Thanks in advance

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

    Hi @Giovanni1 ,

     

    I did a test for you.

    1\ This is my table in Sql server '[dbo].[Table_student]'.

    v-xiaochen-msft_0-1619156767437.png

     

    2\ This is my stored procedure.

    v-xiaochen-msft_1-1619156813489.png

     

    3\ Build an instant flow (1) and run(test) it.

    v-xiaochen-msft_2-1619157354523.png

    Var1: Ask in powerapps

    Var2: Ask in powerapps

     

    View the run history and save the data structure.

    v-xiaochen-msft_3-1619157715706.png

    [
     {
     "Id": 1,
     "name": "Xiaoming",
     "Sex": "hah!",
     "Height": 180,
     "Weight": 120,
     "Chinese": 70,
     "Math": 90,
     "English": 65,
     "TestDate": "2021-03-09T00:00:00"
     }
    ]

     

    4\ Rebuild the instant flow (2).

    v-xiaochen-msft_4-1619157905656.png

    Body:

    body('Execute_stored_procedure_(V2)').ResultSets.Table1
     
    Paste the copied code into the red circle.

     

    5\ Add a button contorl and set its onselect property to:

    ClearCollect(Col,Test49.Run(1,1))

     

    6\ The result is as follows:

    v-xiaochen-msft_5-1619158123250.png

     

    In addition , hope this link will help you. Here

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

     

  • Giovanni1 Profile Picture
    on at

    When I try to enter this code, it gives me an error

  • Giovanni1 Profile Picture
    on at
    It is not possible to enter the code
  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @Giovanni1 ,

     

    The reason it reports an error is that the content I circled in the picture is wrong.

    v-xiaochen-msft_0-1619399935861.png

    Please check my steps again. Please see the steps in the screenshot.

    v-xiaochen-msft_1-1619400000397.png

     

     

    For your second question, the reason why it has no output is because the output is too large, please click it and download it.

    v-xiaochen-msft_2-1619400131444.png

     

    In addition, since the picture you sent contains personal information, in order to protect your privacy, the staff has deleted your picture. Please pixelate your picture and post it again. Thanks. 

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

     

     

     

  • Giovanni1 Profile Picture
    on at

    .

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

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 600

#2
WarrenBelz Profile Picture

WarrenBelz 478 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 322

Last 30 days Overall leaderboard