cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gingerelm
Level: Powered On

transfer data from collection to sharepoint list/excel online

Hi. 

 

this is the context: i have 3 different screens. each screen shows a different subject. Under each subject, there are about 10 courses for users to choose from.

 

I used OnCheck -> Collect(CoursesSelected, {Name: CourseName.Text, Credits: CourseCredit.text}), OnUncheck -> Remove(CoursesSelected, {Name:CourseName.Text, Credits: CoursetCredit.text}) for me to record the courses the users have made on each Subject. 

 

i then placed this collection as a gallery in a new screen called "View Courses Selected". 

 

Here comes my problem. I would like to record the entry(Courses selected) of this user in a new sharepoint list / excel sheet. So when he clicks "confirm courses selected", the data (Course Names, Course Credits of every course the user selected) will be collected automatically on sharepoint/excel.  Is there a way to transfer the data from my Collection to an external source without the user filling in any blanks?

 

Do i have to make use of Flow or Patch or anything that can make this work please let me know!!!!

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: transfer data from collection to sharepoint list/excel online

First you need to create a corresponding SharePoint List, or Excel table with the related columns.

 

Then within PowerApps, we could take use of the Patch () function to submit the collection into SharePoint list.

For example:

Forall(CourseSelected, patch(SharePointList, defaults(SharePointList), {Fieldmatch}))

One thing should be take notice of is make sure the collection and the SharePoint field Name could be distinguished.

 

For how to use patch, see:
Patch() function in PowerApps

 

Regards,

Michael

Community Support Team _ Michael Shao
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

3 REPLIES 3
Community Support Team
Community Support Team

Re: transfer data from collection to sharepoint list/excel online

First you need to create a corresponding SharePoint List, or Excel table with the related columns.

 

Then within PowerApps, we could take use of the Patch () function to submit the collection into SharePoint list.

For example:

Forall(CourseSelected, patch(SharePointList, defaults(SharePointList), {Fieldmatch}))

One thing should be take notice of is make sure the collection and the SharePoint field Name could be distinguished.

 

For how to use patch, see:
Patch() function in PowerApps

 

Regards,

Michael

Community Support Team _ Michael Shao
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

SergiP
Level: Powered On

Re: transfer data from collection to sharepoint list/excel online

What do you mean with: "One thing should be take notice of is make sure the collection and the SharePoint field Name could be distinguished."

 

When I try to Patch my collection I have an error since Patch expects a record and the collection is a table of records.

using the forall with the collection I'd get the records one by one but I don't know how to pass the whole record to the patch.

 

I tried as well using Collect to insert the table of records (my collection) in the SP List but it doesn't work either because of the automatic generated columns, then I removed them with Dorpcolumns, but then I get an error 2 with the Attachment column "Field Requiered"

 

What I try to do is archive items from one SP List into another one. So I build a Collection with a Filter of the first List then try to add this Collection to the archived SP List...

I manage to do it using forall Patch record by record and column by column but is a pain...

SergiP
Level: Powered On

Re: transfer data from collection to sharepoint list/excel online

Finally I found out!

instead of clearing the columns with DropColumns I had to clear the collection with ShowColumns so that it makes sure you only have the data columns you really need. Then Collect (Sharepoint, Collection) works like charm.

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,872)