cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
vish_p
Level 8

Function using Collection

Since i am new to collection concept i need a bit more clarification on this :

Consider i am linking a sharepoint list as form in my app,now user will be able to fill in details on that columns which are autofetched from sharepoint list ,now after filling in the data when user is going to click on a button it should take all the currently entered data into a collection in background and again if user wish to add data he/she can do the same in that and finally they can exit.
Now when the approver is logging in to my app (using o365 mail id) he should be able to view all these datas which is lying in collection and should be able to export selected rows from that to excel (may be using flow) and then when he clicks on submit all the rows from collection should be bulk uploaded to my linked sharepoint list.

please help me for this requirement 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Function using Collection

Hi @vish_p,

Do you want to use a Collection to save your form data permanently within your app?

If you want to use a Collection to save your form data (the user filled in) permanently within your app, I afraid that there is no way to achieve your needs in PowerApps currently.

The Collection is sometimes used to hold global variables or make a temporary copy of a data source, if your app is closed (current session of your app is closed), this Collection would be deleted/destroyed.

As an alternative solution, you should also save the Collection or currently entered form data into a data source (e.g. Another SP List) when you save the currently form data into a Collection. Then when your app re-loads, pull the saved data from your data source (mentioned above) into the Collection.

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

ClearCollect(TempCollection,'YourAnotherSPList')

Set the OnSelect property of the Button control within your Edit screen (contains Edit form) to following:

Collect(TempCollection,EditForm1.Updates);  /* <-- Save current form data into a Collection */
Patch( /* <-- Save current form data into another data source also */
'YourAnotherSPList',
Defaults('YourAnotherSPList'),
EditForm1.Updates
)

Note: The 'YourAnotherSPList' represents the another SP List I mentioned above. This SP list has same data structure/schema as your linked SP list (your Edit form connects to). The EditForm1 represents the Edit form control within your app.

More details about the Collection function, please check the following article:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-clear-collect-clearc...

 

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
Community Support Team
Community Support Team

Re: Function using Collection

Hi @vish_p,

Do you want to use a Collection to save your form data permanently within your app?

If you want to use a Collection to save your form data (the user filled in) permanently within your app, I afraid that there is no way to achieve your needs in PowerApps currently.

The Collection is sometimes used to hold global variables or make a temporary copy of a data source, if your app is closed (current session of your app is closed), this Collection would be deleted/destroyed.

As an alternative solution, you should also save the Collection or currently entered form data into a data source (e.g. Another SP List) when you save the currently form data into a Collection. Then when your app re-loads, pull the saved data from your data source (mentioned above) into the Collection.

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

ClearCollect(TempCollection,'YourAnotherSPList')

Set the OnSelect property of the Button control within your Edit screen (contains Edit form) to following:

Collect(TempCollection,EditForm1.Updates);  /* <-- Save current form data into a Collection */
Patch( /* <-- Save current form data into another data source also */
'YourAnotherSPList',
Defaults('YourAnotherSPList'),
EditForm1.Updates
)

Note: The 'YourAnotherSPList' represents the another SP List I mentioned above. This SP list has same data structure/schema as your linked SP list (your Edit form connects to). The EditForm1 represents the Edit form control within your app.

More details about the Collection function, please check the following article:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-clear-collect-clearc...

 

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
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (10,026)