Gallery Resetting Scroll Bar Workaround

By July 24, 2018PowerApps, Pro Tips

Recently, Microsoft has made some updates to PowerApps and changed how galleries operate. If you use checkboxes or textboxes inside galleries to update a collection, you’ll run into these changes and find one of them somewhat frustrating.

The Problem

Scroll down a gallery and click a checkbox or change a value in a text field.

Notice that the gallery automatically hops back up to the top of the list. You end up losing your spot and must scroll down again back to where you were.

This occurs because the collection that the gallery is based from is being updated. Here’s a way around that.

The Solution

1. Create 2 collections with the same information. Here I made the source for Equipment2 to be Equipment.

2. Have the gallery look at the first collection.

3. On the checkbox, let the checkbox patch the second collection instead of first.

4. When you scroll down and click the checkbox, the gallery won’t reset because you’re updating Equipment2 instead of Equipment.

What you can do next is recollect the changes back to Equipment or just leave it as it is depending on what your workflow is in your app.