Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Retain selected values in a dropdown

(0) ShareShare
ReportReport
Posted on by 321

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

Categories:
  • Verified answer
    Re: Retain selected values in a dropdown

    Hi @JimboSey ,

     

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

    vJessicaGmsft_0-1643103413996.png

     

    Best Regards,

    Jessica Gu

  • JimboSey Profile Picture
    JimboSey 321 on at
    Re: Retain selected values in a dropdown

    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.

  • avootla1 Profile Picture
    avootla1 31 on at
    Re: Retain selected values in a dropdown

    @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 Profile Picture
    JimboSey 321 on at
    Re: Retain selected values in a dropdown

    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

  • C-Papa Profile Picture
    C-Papa 1,836 on at
    Re: Retain selected values in a dropdown

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

  • JimboSey Profile Picture
    JimboSey 321 on at
    Re: Retain selected values in a dropdown

    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 Profile Picture
    C-Papa 1,836 on at
    Re: Retain selected values in a dropdown

    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

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,445

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,741

Leaderboard