cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AKB_2K
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
v-yutliu-msft
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
v-yutliu-msft
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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,644)