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 / Display form linked to...
Power Apps
Answered

Display form linked to Gallery is resetting to 1st item in the gallery list

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hey Everyone,

 

I have a 3 screen app.

  • 1st screen showcasing Gallery picking up items from SharePoint List. Gallery name - ChangeList
  • 2nd screen displaying a form which showcase the details of the item selected in Gallery - ChangeList.Selected
  • 3rd screen showcases a Edit form which also points to same item of Gallery - ChangeList.Selected

At present the list has 300 items. There is no issue in displaying the Gallery based on List data. Now On Screen 1, I am also using a gallery filter which filters the ChangeList gallery data. Once I navigate to 2nd screen and then click on edit, everything works great. The moment I save the data on screen 3 and app navigates me back to Screen 2 using navigate command, Form in Screen 2 suddenly points to 1st item of the gallery instead of selected. This is causing confusion and weird app behavior.

 

I tried to resolve this by adding a variable to the gallery on Screen 1, 

 

Navigate(Screen2,ScreenTransition.None,{itemSelect: ThisItem});

 

and then setting item for form in screen2 to itemSelect. This resolves the problem of app randomly picking up 1st gallery item but the changes I am making on Screen 3 is not getting updated for the variable. Is there a update statement I can use to refresh itemSelect variable with updated data and showcase it on Screen 2?

 

Thanks,

AK

Categories:
  • Verified answer
    v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Do you mean that your display form will change to first item or not update?

    I've made a similar test but not met the same problem like your description.

    Here's my test for your reference:

    in my test, gallery in screen3, display form in screen4, edit form in screen5

    1)In screen3

    insert a gallery, set its data source to your list

    set its arrow button's OnSelect:

    Navigate(Screen4)

    12171.PNG

     

    2)in screen4

    insert a display form, two buttons, one for backing to home, one for jumping to edit form

    Set the display form's data source to your list

    Set the display form's Item: Gallery2.Selected

    Set the home button's OnSelect:

    Navigate(Screen3)

    set the edit button's OnSelect:

    EditForm(Form1);Navigate(Screen5)

    12172.PNG

     

    3)in screen5

    insert an edit form , two buttons, one for submitting, one for backing to display form

    Set the edit form's data source to your list

    set the edit form's Item:

    Gallery2.Selected

    set the submit button's OnSelect:

    SubmitForm(Form1)

    set the back button's OnSelect:

    Back()

    12173.PNG

     

    What's more, please check whether you've updated successfully.

    You could also add refresh function in back button.Try this:

    Refresh(listname);Back()

     

     

    Best regards,

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Not sure who marked this as Solved but above solution did not work for me.

     

    What I found in my testing is that when data and form fields are quite big, Back() functionality was actually not working properly on saving the Edit form. It was the culprit in my case which was resetting the view form to first item shown in Gallery even when view form item was marked as Galleryname.selected. Using "Navigate" function solved the issue for me, so I just replaced Back() command with Navigate.

     

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 345 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 312

#3
Mohsin Ali Profile Picture

Mohsin Ali 252

Last 30 days Overall leaderboard