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

Resetting a drop down list when returning to the page

My initial screen is a list screen.  One of the fields is a drop down list.  This drop down list is where the user will select which page to go to.  It starts with Select (which takes you nowhere).

 

When the user picks an option and hits save on that screen, it returns to the initial screen and the drop down list resets to have Select showing.  If the user hits cancel on that screen, it does NOT reset the drop down list to Select.

 

Here is the OnSelect for the Save.

// Shows overlay on save
UpdateContext({OverlayVisible: true});

If(SubmitForm(EditSetupNotesPage),
Refresh(CustomerMaster_v3);
Navigate(CustomerList, ScreenTransition.Fade),

// hides overlay on error
UpdateContext({OverlayVisible: false}))

 

Here's the OnSelect for the Cancel:

Refresh(CustomerMaster_v3); Back(ScreenTransition.Fade)

 

What do I need to do to get the dropdown to reset?  I am attaching a screenshot that shows you how it returns back when I hit cancel.

 

 
29 REPLIES 29

Like this?

 

image.png

I might be running out of ideas but would continue to try (I think i am missing something basic).

Can you try this for the OnSelect property of the Cancel button?

UpdateContext({OverlayVisible: true});
Refresh(CustomerMaster_v3);
Navigate(CustomerList, ScreenTransition.Fade),
UpdateContext({OverlayVisible: false}))

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
https://thepoweraddict.com

That gives an error.  Says I don't need the comma after Navigate(CustomerList, ScreenTransition.Fade),

 

I did this and it still didn't work

UpdateContext({OverlayVisible: true});
Refresh(CustomerMaster_v3);
Navigate(CustomerList, ScreenTransition.Fade)

Let me know if you can do a screen share with me via Teams or any other software.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

I'm about to head out for the day.  Can we try it tomorrow?

Community Support
Community Support

Hi @mistysmith ,

Where do you put your "Save" button and "Cancel" button? Within the Gallery?

Do you want to reset the Dropdown list within your Gallery?

Further, do you set up a column (e.g. Text Type column) in your data source to store the Dropdown list selected value?

 

Based on the needs that you mentioned, I think a global variable could achieve your needs. I have made a test on my side, please consider take a try with the following workaround:

Set the OnSelect property of the "Cancel" button to following:

Set(IsReset, false);Set(IsReset, true); // Add this formula
Refresh(CustomerMaster_v3);
Back(ScreenTransition.Fade)

 

Set the Reset property of the Dropdown box in the Gallery to following:

IsReset

Set the Default property of the Dropdown box in the Gallery to following:

ThisItem.'SelectedPage Column'

Note: The 'SelectedPage Column' represents the Text Type column in your data source, to store the Dropdown List selected value when you click "Save" button.

On your side, you could consider set the OnSuccess property of the EditSetupNotesPage form to following:

Patch(              // Update the Dropdown list selected value back to your data source when you submit your form data successfully
      'Data Source',
       EditSetupNotesPage.LastSubmit,
       {
         'SelectedPage Column': DropdownListBox.Selected.Value
       }
)

 

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.

Is true the Reset property of the Dropdown ?

 

Yes, Reset is set to true.

Hi @mistysmith ,

Have you taken a try with the solution I provided above? Based on the needs that you mentioned, I think a global variable could achieve your needs.

 

Please consider take a try with the solution I provided above, then check if the issue is fixed.

 

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.

I got pulled to work on something different yesterday.

 

I'm not sure why I need to do anything with the Save part since it resets the drop down correctly.  I want it to go back to Select, which is the first  item in the list.

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (59,500)