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

After submitting changes app displays first record instead changed record

Hi guys. My app runs really quirky. When I edit a record from gallery and submit the changes, it displays first record from gallery, instead changed record. What is wrong? How can I fix it?

Snímka obrazovky 2022-01-13 o 12.42.04.png

1 ACCEPTED SOLUTION

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

Hi @MonteTT,

Do you mean that your form display the first record instead of the changed record after submitting?

Could you please share a bit more about the Item property of the Form?

 

I have a test on my side and it works as expected if I set the Form Item property as Gallery.Selected. Every time you submit the form, the form will always display the latest edited record.

 

How you set the Item property of the form will decide what it displays. If you do not have extra filter formula for your Gallery Items, I would suggest you sort the Gallery items based on the modified, which will make the Gallery always display the latest edited record as the first one and you would never worry about the form display issue.

 

You could consider setting the OnSuccess and Item property of the Form as below:

Refresh(ListA) // OnSuccess property     

Set the Gallery Items property as below:

Sort(ListA,Modified,Descending)

 

 

Best Regards,
Qi

View solution in original post

2 REPLIES 2
v-qiaqi-msft
Community Support
Community Support

Hi @MonteTT,

Do you mean that your form display the first record instead of the changed record after submitting?

Could you please share a bit more about the Item property of the Form?

 

I have a test on my side and it works as expected if I set the Form Item property as Gallery.Selected. Every time you submit the form, the form will always display the latest edited record.

 

How you set the Item property of the form will decide what it displays. If you do not have extra filter formula for your Gallery Items, I would suggest you sort the Gallery items based on the modified, which will make the Gallery always display the latest edited record as the first one and you would never worry about the form display issue.

 

You could consider setting the OnSuccess and Item property of the Form as below:

Refresh(ListA) // OnSuccess property     

Set the Gallery Items property as below:

Sort(ListA,Modified,Descending)

 

 

Best Regards,
Qi
MonteTT
Helper I
Helper I

Hi @v-qiaqi-msft .

I had already set Item as BrowseGallery1.Selected in both, Display form and Edit Form.

 

In the BrowseGallery1 are records ordered by title ascending and user can filter by multiple criterias. However, all ran correctly at start developing and app. So I think I set something wrong later. But I have no idea what it could be.

Anyway, if I change ordering the records by update date as you suggest, app runs correctly. Thank you for hint 🙂

 

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,142)