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

Unsaved changes notification when user select gallery

Hi All.

I have a gallery called OrderRequestGallery and a form called OrderForm. User can fill in and submit OrderForm. Later, they can view their orders in OrderRequestGallery.

My problem is that I want to notify the user that they have unsaved changes. This happens when user edited OrderForm, but suddenly they selected other items in OrderRequestGallery without submitting the form first.

Can anybody helps me?
Thank you!
1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @_kikilalaaa ,

I have made a test on my side, please consider take a try with the following workaround:

7.JPG

 

8.JPG

Set the OnSelect property of the Gallery to following:

If(
   Form1.Unsaved,  /* <-- Form1 represents the Edit form in your app */
   Notify("You have some changes not been saved, please saved your form data firstly!", NotificationType.Warning), 
   Set(CurrentItem, ThisItem)
)

Set the Item property of the Edit form (Form1) to following:

CurrentItem

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
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

3 REPLIES 3
v-xida-msft
Community Support
Community Support

Hi @_kikilalaaa ,

I have made a test on my side, please consider take a try with the following workaround:

7.JPG

 

8.JPG

Set the OnSelect property of the Gallery to following:

If(
   Form1.Unsaved,  /* <-- Form1 represents the Edit form in your app */
   Notify("You have some changes not been saved, please saved your form data firstly!", NotificationType.Warning), 
   Set(CurrentItem, ThisItem)
)

Set the Item property of the Edit form (Form1) to following:

CurrentItem

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
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

Hi, thanks for your reply, it works for me but then it has distract other function, which is the templatefill for the gallery is supposed to be blue colour if the item is selected. But, since I use the var current item, the item does not change its colour when it is selected.

I tried to set the templatefill like this:
If(ThisItem.IsSelected = CurrentItem, Blue, White)

But it doesn't work.

Previously, i set the item in form ="OrderGallery. Selected",

and the templatefill in gallery
=(If(ThisItem.IsSelected, Blue, White))

And it works fine.

Please help!

Hi @_kikilalaaa ,

Based on the issue that you mentioned, I think you have some misunderstanding with the ThisItem.IsSelected formula within Gallery control.

The result the ThisItem.IsSelected formula returned is a Boolean value (true/false), which could not be compared with a record value directly. On your side, you need to set the TemplateFill property of the Gallery to following:

If(ThisItem.IsSelected, Blue, White)

2.JPG

 

If you have solved your problem, please consider go ahead to click "Accept as Solution" to identify this thread has been solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

Top Solution Authors
Users online (2,251)