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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (2,951)