If I understand correctly:
- You want to call a SQL Server stored procedure called get_customer
- You do not see the option in PowerApps
- You have a button on Screen1 you want to click to call the sproc and return its result
The method I have been calls the stored procedure through Flow. Here's a general idea of how to construct this flow:
- Insert the PowerApps trigger as the first step in your flow
- Search for SQL and select the action for 'Execute a SQL stored procedure'
- Select get_customer from the dropdown menu for SQL stored procedures
- Test out the flow so you can get sample data. View its results.
- In the output of the SQL action, copy the sample data from square bracket [ to square bracket ] to use for generating JSON schema in the next step
- Edit the flow again
- Search for and insert the 'Request - Response' action
- Click 'Use sample payload to generate scheme' and paste the sample data
- Configure the body of the Request Response step as:
body('Execute_a_SQL_stored_procedure').ResultSets.Table1
The naming in this step may vary depending on your setup.
- Name your flow, then same it.
In PowerApps, select your button. You can bind it to the flow you just created:
Action > Flows > select your flow
Collect the results of your flow to a collection.
- Test out your button. View your Collections to see how it did
Here is a more precise blog on the related topic for executing a general query, but it applies to your question:
https://powerapps.microsoft.com/en-us/blog/return-an-array-from-flow-to-powerapps-response-method/
Here is a video demonstrating the flow and the Response action in multiple contexts:
https://www.youtube.com/watch?v=MoifwDFKSTo
Please let me know if this has helped.
Mr. Dang