cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mattw112IG
Impactful Individual
Impactful Individual

How to force a Gallery to refresh its cards

I have a gallery, I have an edit form

When I submit the edit form would like the gallery item to refresh it's card with latest data

Data currently gets loaded to a collection when powerapp starts

"Refresh()" doesn't seem to work.

How would I do this?

ClearCollect?

 

Thanks,

Terry

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @Mattw112IG ,

Do you mean that your data is saved in a collection and the gallery display the data in the collection?

Do you want to refresh the gallery items when you update your data source?

The reason why you met the problem is that:

1)Refresh() function is used to refresh data source, not collection

2)If you update your data source, data in the collection will not be updated automatically, you need to recreate the collection with the latest data of your data source.

So here are two solutions for you choosing:


1)use the data source as the gallery's Items directly, not the collection

Then set the form submit button's OnSelect:

SubmitForm(Formname);Refresh(data source name)

 //refresh the data source after you submit data

 

2)still use the collection as the gallery's Items

set the form submit button's OnSelect:

 

SubmitForm(Formname);ClearCollect(collectionname,data sourcename)

 

//recreate collection after you update the data source.

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
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

2 REPLIES 2
WarrenBelz
Super User
Super User

HI @Mattw112IG ,

You need to refresh your data source

Refresh(YourDataSourceName)

This is assuming your gallery Items are directly from the list (not a collection)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

v-yutliu-msft
Community Support
Community Support

Hi @Mattw112IG ,

Do you mean that your data is saved in a collection and the gallery display the data in the collection?

Do you want to refresh the gallery items when you update your data source?

The reason why you met the problem is that:

1)Refresh() function is used to refresh data source, not collection

2)If you update your data source, data in the collection will not be updated automatically, you need to recreate the collection with the latest data of your data source.

So here are two solutions for you choosing:


1)use the data source as the gallery's Items directly, not the collection

Then set the form submit button's OnSelect:

SubmitForm(Formname);Refresh(data source name)

 //refresh the data source after you submit data

 

2)still use the collection as the gallery's Items

set the form submit button's OnSelect:

 

SubmitForm(Formname);ClearCollect(collectionname,data sourcename)

 

//recreate collection after you update the data source.

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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 (1,627)