cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
marcobb
Frequent Visitor

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

marcobb
Frequent Visitor

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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,036)