web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Gallery selection auto...
Power Apps
Unanswered

Gallery selection auto resets

(0) ShareShare
ReportReport
Posted on by 2

Hi,

I am using a Gallery to list customer records and a Form to show customer records selected in Gallery.

I am facing problem of Gallery getting reset once I click on button to save form.

I found similar problem others had previously and shared it on community forum. I tried all suggested solution in those old messages and still unable to resolve it.

I tried @WarrenBelz & @v-monli-msft suggested solutions in earlier messages in the year 2019 and 2022 and it is still not solving my problem. Gallery is getting reset when Save button save the attachment from the Form.

Gallery:

Default: Lookup( Database Table Name, 'Customer_ID' =varID)

OnSelect: UpdateContext({varID:ThisItem.'customer_ID'})

 

Form:

Save button is outside form.

OnSelect: SubmitForm(Customer_Form);

 

Attachment Card on Form:

Default: ThisItem.Attachments

 

Attachment Control in Card:

Default: blank

Items: Parent.Default

 

I am using attachment control on form and after attaching few files in attachment control when I submit form, the Gallery is reset and I loose selected row in gallery.


Any suggestions, Ideas, advice will be appreciated. 

Categories:
  • WonderSerota Profile Picture
    80 on at

    I think instead of using Lookup directly in the Gallery's Default property, try using ClearCollect to collect the data into a local collection, and then use that collection as the data source for the Gallery. This can help in avoiding delegation issues.

    Code:

    OnVisible: ClearCollect(CustomerData, Filter('Database Table Name', 'Customer_ID' = varID))

    Default: CustomerData.

     

    I hope this helps.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 283

#3
Mohsin Ali Profile Picture

Mohsin Ali 221

Last 30 days Overall leaderboard