cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
phearin
Helper III
Helper III

Save gallery row

Dear Support team,

 

The subject might be generic to you. Let me describe a bit about my question. 

 

Actually, we are doing sth to display employee list under line manager to appear in the gallery with adding textinput where we allow to input data and click submit button. 

 

We are using collection and patch those information to our table in sharepoint.

 

The coding and flow is working well.  However, when we close the screen then start it again, then in the gallery, it will refresh to the blank field one, because collection won't store record.

 

Is there anyway where we can show the previous record to the screen?  Thanks, PS

 

 

2020-08-05 15_12_55-Let's Talk & 360 Feedback - Power Apps.png

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @phearin :

Could you tell me whether this app is opened in a browser or on a mobile device?

If this app is opened in a browser,I suggest you don't use collection to save the data.

If this app is opened on a mobile device, I suggest you save the collection locally before closing the app, and then load the collecion the next time you open the app (to prevent the data in the collection from disappearing after closing the app).

The point is using SaveData function and LoadDate function.I've made a test for your reference:

I created a collection "TestCollection" using a button

 

ClearCollect(TestCollection,{Value:"Test"},{Value:"Test"})

 

and created a table to dispaly the collection.

1\Set the button's OnSelect Proeprty to:

ClearCollect(TestCollection,{Value:"Test"},{Value:"Test"});SaveData(TestCollection,"SaveTestCollection")

2\Set the apps OnStart Property to:

LoadData(TestCollection,"SaveTestCollection")

35.gif

When I open the app again, the data in the collection still exists.

I think this link will help you a lot:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-savedata-loaddata

Best Regards,

Bof

 

 

 

View solution in original post

1 REPLY 1
v-bofeng-msft
Community Support
Community Support

Hi @phearin :

Could you tell me whether this app is opened in a browser or on a mobile device?

If this app is opened in a browser,I suggest you don't use collection to save the data.

If this app is opened on a mobile device, I suggest you save the collection locally before closing the app, and then load the collecion the next time you open the app (to prevent the data in the collection from disappearing after closing the app).

The point is using SaveData function and LoadDate function.I've made a test for your reference:

I created a collection "TestCollection" using a button

 

ClearCollect(TestCollection,{Value:"Test"},{Value:"Test"})

 

and created a table to dispaly the collection.

1\Set the button's OnSelect Proeprty to:

ClearCollect(TestCollection,{Value:"Test"},{Value:"Test"});SaveData(TestCollection,"SaveTestCollection")

2\Set the apps OnStart Property to:

LoadData(TestCollection,"SaveTestCollection")

35.gif

When I open the app again, the data in the collection still exists.

I think this link will help you a lot:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-savedata-loaddata

Best Regards,

Bof

 

 

 

View solution in original post

Helpful resources

Announcements
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

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

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 (2,309)