cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Reading data from table then updating to sharepoint list

I'm trying to read in data from a sql table, then update data in the firm and then save updates into a SharePoint list. How can this be accomplished easily? Thank you.
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Reading data from table then updating to sharepoint list

Hi @cosikes,

Could you please share a bit more about your scenario?

Do you want to pull data from your SQL table into your app, and then update the data within your app (using Edit form), then save the updates date into your SP list?

Firstly, you could consider save retrieved data (from your SQL table) into a Collection within your app (Using ClearCollect function), then use the Collection as a data source within your app. You could do some updates/changes on the Collection within your app, after that, submit the updates data (Collection) into your SP list using Patch function.

I have made a test on my side, please take a try with the following workaround:

  • Set the OnVisible property of the first screen of your app to following:

 

ClearCollect(RecordsCollection, '[dbo].[YourSQLTable]')  /* <-- [dbo].[YourSQLTable] represents your SQL table */
  • Use above created Collection as a data source within your app, then do some changes/updates on it.
  • Submit above updated Collection into your SP list using Patch function. The standard formula format of Patch function as below (Set OnSelect property of a Button control to following):
ForAll(
 RecordsCollection,
 Patch(
            'YourSPList',            /* <-- 'YourSPList' represents your SP list */
             Defaults('YourSPList'),
             {
               ListColumn1: CollectionColumn1,
               ListColumn2: CollectionColumn2,
               ListColumn3: CollectionColumn3,
               ...
             }
          )
)

More details about submitting a Collection into a SP list, please check the following article:

https://powerusers.microsoft.com/t5/General-Discussion/Submit-a-Collection-to-a-SharePoint-List/td-p...

 

More details about the Patch function and ForAll function, please check the following article:

Patch function

ForAll function

 

Best regards,

Kris

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Highlighted
Community Support
Community Support

Re: Reading data from table then updating to sharepoint list

Hi @cosikes,

Could you please share a bit more about your scenario?

Do you want to pull data from your SQL table into your app, and then update the data within your app (using Edit form), then save the updates date into your SP list?

Firstly, you could consider save retrieved data (from your SQL table) into a Collection within your app (Using ClearCollect function), then use the Collection as a data source within your app. You could do some updates/changes on the Collection within your app, after that, submit the updates data (Collection) into your SP list using Patch function.

I have made a test on my side, please take a try with the following workaround:

  • Set the OnVisible property of the first screen of your app to following:

 

ClearCollect(RecordsCollection, '[dbo].[YourSQLTable]')  /* <-- [dbo].[YourSQLTable] represents your SQL table */
  • Use above created Collection as a data source within your app, then do some changes/updates on it.
  • Submit above updated Collection into your SP list using Patch function. The standard formula format of Patch function as below (Set OnSelect property of a Button control to following):
ForAll(
 RecordsCollection,
 Patch(
            'YourSPList',            /* <-- 'YourSPList' represents your SP list */
             Defaults('YourSPList'),
             {
               ListColumn1: CollectionColumn1,
               ListColumn2: CollectionColumn2,
               ListColumn3: CollectionColumn3,
               ...
             }
          )
)

More details about submitting a Collection into a SP list, please check the following article:

https://powerusers.microsoft.com/t5/General-Discussion/Submit-a-Collection-to-a-SharePoint-List/td-p...

 

More details about the Patch function and ForAll function, please check the following article:

Patch function

ForAll function

 

Best regards,

Kris

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (7,822)