cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper II
Helper II

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

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

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support
Community Support

Hi @AKB_2K ,

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,

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

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.

 

View solution in original post

2 REPLIES 2
Community Support
Community Support

Hi @AKB_2K ,

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,

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

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.

 

View solution in original post

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (4,867)