cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

SQL-SharePoint-PowerApps integration

I am working on a flow that is triggered by Power Apps. Once triggered:

  1. SharePoint shall send a list (one-field-records with only the key field) to a SQL server
  2. The SQL server should select only the records in the received list
  3. The SQL server should return the result to SharePoint as a SharePoint list

Example: SharePoint send a name list of students. Then the SQL list containing all students' results should return the results only for the student in the name list.

So far I only know about using the Power Apps trigger and SharePoint actions to complete (1). However, is Power Automate capable in doing (2) and (3)? Please advice on the solution, or alternatives otherwise.

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User III
Dual Super User III

The easiest way to do this is by creating a SQL stored procedure that will complete task #2.  You can pass the records in as an array and have the stored procedure pick and return an array of records.  For #3 you'll need to use the HTTP response action.  Using that you can send the array of results from SQL back to Power Apps.  They won't come in as a SharePoint list, but can be captured as a collection.

 

This article details how to call the flow from Power Apps, call a stored procedure and return the results to Power apps.

Return an array from a SQL Stored Procedure to PowerApps (Split Method) | Microsoft Power Apps



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

3 REPLIES 3
Pstork1
Dual Super User III
Dual Super User III

The easiest way to do this is by creating a SQL stored procedure that will complete task #2.  You can pass the records in as an array and have the stored procedure pick and return an array of records.  For #3 you'll need to use the HTTP response action.  Using that you can send the array of results from SQL back to Power Apps.  They won't come in as a SharePoint list, but can be captured as a collection.

 

This article details how to call the flow from Power Apps, call a stored procedure and return the results to Power apps.

Return an array from a SQL Stored Procedure to PowerApps (Split Method) | Microsoft Power Apps



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

Anonymous
Not applicable

Hi @Pstork1,

Thanks for the suggestion! However, I would like to have the SQL query results sent to SharePoint because the forms and cards in Power Apps in currently built on a SharePoint list. At the end of the day, it would be best if I can maintain one updated SharePoint list that Power Apps uses. Is there any way I can achieve so? Many thanks in advance.

Pstork1
Dual Super User III
Dual Super User III

You can send the results directly to SharePoint in the flow, but they wouldn't then be reflected in the Power App until you refresh the form/gallery.  You can return the results to a collection and then have Power Apps update SharePoint using the collection.  The collection is just a local cache of the results, like a variable. It isn't a replacement for the SharePoint list or a permanent storage location.



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

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Kudoed Authors
Users online (2,041)