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

confirmation for dropdown change

I have a dropdown menu where the selected item determines the type of items that populate a gallery via another form. If someone changes the dropdown menu after adding items to the gallery, it deletes everything and starts from scratch. I would like to have a confirmation window pop up before the combobox selected item actually changes:

This is what I have so far:

1. OnChange for the dropdown box

Jsharkey_0-1601413851461.png

2. Visible property for the pop up window:

Jsharkey_1-1601413908873.png

On select for the confirm button of the pop up:

Jsharkey_2-1601413981516.png

On select for the cancel button of the pop up:

Jsharkey_3-1601414036556.png

Lastly I have the DefaultSelectedItems property of the combobox as follows:

Jsharkey_4-1601414092702.png

 

The event fires after the box changes successfully meaning that functionally, the selected item will change, but if they press cancel, it should revert. However, even if I press cancel the combo box's value still changes. 

If anyone has a suggestion of how I can implement this it would be greatly appreciated.

 

6 REPLIES 6
VijayTailor
Resident Rockstar
Resident Rockstar

HI @Jsharkey ,

please find the below Approach.

Add Toggle into Screen and Set te Default Value that you are using for the OnChange properties.
(No Need to Use UpdateContext) Just Use Conditions like that If(value1=value2 ,true,false)

VijayTailor_0-1601417045980.png

Now Hide the Toggle.

Now Display the popup  Based on Toggle value.

VijayTailor_1-1601417176571.png

Hope this solution helps you to resolve your issue.
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

The visible property for the pop up window works fine.

 

I'm trying to present a confirmation message when a user changes the dropdown menu selection ---> I need to change the value of the dropdown menu when the user presses a button:

 

When the dropdown selection changes we show the popup (the criteria here is correct and can be ignored).

 

Since we can't prevent the value of the dropdown from actually changing, the following executes after OnChange of the dropdown:

 

confirm button: keep the dropdown selection the same, update currentCategory

cancel button: change the dropdown selection back to currentCategory, don't update currentCategory

 

the dropdown DefaultSelectedItems: Coalesce(currentCategory, Parent.Default)

 

The problem with the above is that for some reason when I press the cancel button, the dropdown item does not revert to the previously selected item. It remains changed.

Desired functionality:

- Dropdown currently selected item is "Customer"

1. Change dropdown to "Contractor" dropdown, confirmation appears

2. Click the cancel button indicating we would not like to change. 

3. The dropdown reverts back to "Customer"  

Current functionality:

- Dropdown currently selected item is "Customer"

1. Change dropdown to "Contractor" dropdown, confirmation appears

2. Click the cancel button indicating we would not like to change. 

3. (The issue) The dropdown does not revert back to "Customer"  

@VijayTailor Any other ideas?

Hi @Jsharkey , 

 

On Pop cancel button dont change the value just reset the combobox, that will reset the defaultselectedValue. 

Try this once. 

Thanks

tried the suggested:

Reset(cboCategory) does not work.
Because the combobox is inside of a form, I cannot reset it from outside of the form (the cancel button is outside of the form)

Thanks, 

Josh

Ohk Then .Last Option Tried and Test with Form.

For reference - 

VijayTailor_0-1601658381323.png

Thanks

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,881)