Showing results for 
Search instead for 
Did you mean: 
Post Prodigy
Post Prodigy

Dynamic gallery collection to Sharepoint list



I have a gallery that has a collection as data source. And inside this gallery there are two input text boxes (single and multi)


This collection allows to add dynamically task (someone fill one task, click ADD more and he can add more tasks).

But collection is only up to the moment someone close the app.


When someone reload app he does not see this tasks.



Gallery2 Items:






OnVisible screen:



If(CountRows(colNumberedGUIDS) = 0,ClearCollect( colNumberedGUIDS, {Value:GUID(),RowNumber:1}))



Add task:



        {Value:GUID(), RowNumber:CountRows(colNumberedGUIDS) + 1}




The idea for this solution is to allow someone to add tasks whole day review it and then save it at the end of the date.

I have no idea what to do - I want user to fill the task all day, but then when they reload app they won't see it since gallery data source is already a collection (which on the other hand does not include data from input boxes - weird solution).


Does any of you have idea what to do?

Do I need another gallery with a sharepoint list data source?


Or can it be somehow done.


To sum it up from user perspective.

1. There is a gallery with two input boxes (Name, description).

I feel those tasks and click Save.

2. I come back later to add another task (my previous task is visible). I click add task and another task in gallery is shown.

3. I click save and leave up.

4. At the end of the day I come and click finish job and all records are saved once again, but i lose access to this screen, and it's archived.


Is this achievable? 


Advocate III
Advocate III

You will need to start to look at working Offline with Power Apps - Shane Young's videos are a great introduction to these but you're using collections o you're well on the way in the right direction.



Should I use collection tho?

Collection should remain till user click a button.

Advocate III
Advocate III

Yes always use a collection, then you will need to decide when to use SaveData to make sure you have captured the entries (clicking Save), then clear the collection when you Archive so you're starting from fresh the next time.

Like it? please click the Thumbs Up button!
Problem Solved? please click the Accept as Solution button to help other Community members find the answer as well!


My app is made for browser, and SaveData LoadData does not work in browser!


So right now mobile users can save data locally and PC ones are left with nothing.


This means that I have to allow users to Patch data with Save button, but then how will they view this data when gallery is made with collection.


My function for collecting in gallery:

{Value:GUID(), RowNumber:CountRows(colNumberedGUIDS) + 1,Nazwa:Zadanie_nazwa.Text,Opis:Zadanie_opis.Text}


When I patch this data it will be in sharepoint list and not in gallery anymore.

So to view data I will not to have Sharepoint list as a source.


Or should I preload collection with sharepoint list data?

But this is very hard. It need to select only records from a certain date and created by this user to not show all data from sharepoint list.


The stuff that Shane did were quiet easy, but this is on another league for me.


Logically this should work like that:


1. User open gallery that has collection and fill initial task.

2. He can click a button next task or save data.


Saving data mean that it is saved in the database and can be viewed after reloading app.


Ah, yes browser users will face this issue - but as they are using a browser then yes just save back to the SP list and refresh the control/datasource afetrwards to reload the data (no need to reload the whole app).

Personally yes I would use a collection, but you don't have to and could Filter directly on the SP list.

Also check out the app ConfirmExit and ConfirmExitMessage options to maybe prompt your users to Save anything they should before exiting the app.


Like it? please click the Thumbs Up button!
Problem Solved? please click the Accept as Solution button to help other Community members find the answer as well!

Helpful resources

PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

Top Solution Authors
Top Kudoed Authors
Users online (3,754)