cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PaulD1
Super User
Super User

Bug: Selecting a record in Gallery takes you to the wrong record in a related form

Sometimes, when you select an entry in a Gallery which takes you to another screen with Form and Gallery controls where Item is set to Gallery.Selected, PowerApps will display the wrong record in the related controls. The issue is related to the timing of the click/tap in the Gallery (has the screen fully refreshed).

 

Setup:

I have an OrderHeaders table and OrderDetails table in SQL Azure DB.

In my PowerApp I have a screen with gallery galOrderHeader.

I have another screen with a form frmOrderHeader that shows the details of the OrderHeader selected in galOrderHeader. This screen also has a Gallery galOrderDetail showing the OrderDetails related to the OrderHeader selected in galOrderHeader.

A 'Next' button in galOrderHeader takes the user to the screen with frmOrderHeader and galOrderDetail.

 

Observed Behavior (App contains two OrderHeader records, Bob and Jane:

1. Click entry 'Jane' in galOrderHeader to open the screen with frmOrderDetail and galOrderDetail. Correct data is displayed.

2. Click 'go back' to return to the first screen. 

3. Wait for the screen to fully refresh.

4. Click entry Bob in galOrderHeader to open the screen with frmOrderHeader and galOrderDetail. Correct data is displayed.

5. Click 'go back' to return to the first screen.

 

Now perform the above steps again, but do not wait for the first screen (with galOrderHeader) to fully refresh in step 3. You will still be able to click the button to take you to the next screen - initially, you will see the record for Bob but after a second or two it will change to show Jane again. I have even seen the frmOrderHeader show the details for one record but galOrderDetail show details for another.

 

This behavior is the same in the editor, web player and on mobile.

 

The correct record should always be shown in the related controls, even if that means preventing a user from making a selection until the Gallery has finished refreshing.

 

Screen recording demonstrating the bug: https://1drv.ms/v/s!Ag1ZVAvAeJJnt70lD6q7PyOzXN09HA

 

 

 

15 REPLIES 15

I've got this logged with support as a demonstrated bug in web/win/ios/droid apps.  Enhanced rendering off doesn't fix it.  Nor does "Explicit Column Selection" in advanced app settings.  The problem is not present in 'simple' gallery item lists; it occurs for me with a complex filtered list (and engineering task list filtered by engineer name and required date).  if i switch off the filtering code, item selection works.  If it switch on then the first time an item is selected after opening the app, the wrong item (in fact the first on the list) is selected.  Return to screen 1, select again and it's OK.  more details here: Bug with complex filtering of gallery

Did you ever figure a robust solution for this? I am struggling with the same issue on my app which contains two galleries presenting the same SP list (one of the gallery is filtered). I believe the opened form is stuck on the previous item opened from the unfiltered gallery when opening from the filtered gallery.

 

EDIT: I got it to work using the variable on screen navigation 🙂

pjbryant
Helper I
Helper I

I didn't need to fix in the end as Microsoft fixed the bug in the product to stop it.  We mixed up educating users to do the work around, and simplifying a second version of the app to avoid it

ElvinV
Frequent Visitor

Hello, Like many others I have the same problem. Now, what is the variable in the form? How does this one should be placed...?

Binntore
Frequent Visitor

Hello,

 

I fixed it in my app by defining a variable every time you click on the gallery item (naming the variable something like "CurrentItem"), and then refering to "CurrentItem" later in the app, instead of the default ThisItem.

yes - in that the bug in the gallery was identified and fixed by Microsoft in a later release of PowerApps (just a few weeks after my post) 

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Solution Authors
Top Kudoed Authors
Users online (2,448)