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

Retain selected values in a dropdown

Afternoon,

 

I have two dropdowns on my screen, which filter a gallery on screen, by status and workplan.

 

Within the gallery I have links to other screens. 

 

I would like to retain the users selections in the dropdown boxes when the user navigates off the screen then back.

 

Is there a way to achieve this?

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
v-JessicaG-msft
Community Support
Community Support

Hi @JimboSey ,

 

You could add the " Reset("Dropdownname") " formula to the screen's onvisible property.

vJessicaGmsft_0-1643103413996.png

 

Best Regards,

Jessica Gu

View solution in original post

7 REPLIES 7
C-Papa
Super User
Super User

yes, with the OnChange property of the dropdown add Set(var_Selected, Self.Selected),

the change the default to var_Selected.

 

for dropdown2 use Set(var_Selected2, Self.Selected), Default = var_Selected2

 

 

Hi, thanks for your reply.

 

When I out var_selected in the Default it says there is an error in the formula with the Data Type: Record.

C-Papa
Super User
Super User

can you post your dropdown items code? Also, are you allowing multi select?

JimboSey
Helper IV
Helper IV

I am not allowing multiple sections.

 

In my items for the dropdown my code is collectProductTitle

 

 

The onvisible code for the screen itself is

 

ClearCollect(collectProductTitle, {Value: "All"});

Collect(collectProductTitle, Choices([@JSConsolidationProductTitle].HLStatus));

ClearCollect(collectWorkPlanChoice, {Value: "All"});

Collect(collectWorkPlanChoice, Choices([@JSConsolidationProductTitle].PT_WorkPlanChoice))

 

 

 

Thanks

avootla1
Frequent Visitor

@JimboSey 

The error is because you are setting a record/row of the collectProductTitle collection.

 

Simply add .Value at the end of the formula. You will see it working.

JimboSey
Helper IV
Helper IV

Do you mean like this...

 

(var_Selected, Self.Selected.Value)

 

If so I added this and the error message went but still reverts back to "All" when I navigate away and back. 

 

I need it to retain the dropdown value I selected.

v-JessicaG-msft
Community Support
Community Support

Hi @JimboSey ,

 

You could add the " Reset("Dropdownname") " formula to the screen's onvisible property.

vJessicaGmsft_0-1643103413996.png

 

Best Regards,

Jessica Gu

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

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.

Users online (1,887)