web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Save listbox and dropd...
Power Apps
Answered

Save listbox and dropdown box selection and load at startup

(1) ShareShare
ReportReport
Posted on by 17
in my app, I have a dropdown box and a listbox. Both controls populate with many items.
I want be able to save the selection of items on both controls and the selection should be loaded at the apps start up. I can have an excel table to save the current selection of the two control.
 
looking for your suggestions to perform the action.
Categories:
I have the same question (0)
  • Verified answer
    tsa-svd2srv Profile Picture
    204 on at
    First, create an Excel table (let's call it "SavedSelections") with these columns:
    • ControlName (Text)
    • SelectedItems (Text) 

    In your PowerApps, add an OnSelect property to both your dropdown and listbox to save selections:

    For the Dropdown:

    Patch(
        SavedSelections,
        LookUp(SavedSelections, ControlName = "Dropdown1"),
        {
            ControlName: "Dropdown1",
            SelectedItems: Dropdown1.Selected.Value
        }
    )
     
    For the Listbox (since it can have multiple selections):
    Patch(
        SavedSelections,
        LookUp(SavedSelections, ControlName = "Listbox1"),
        {
            ControlName: "Listbox1",
            SelectedItems: Concat(Listbox1.SelectedItems, Value, ",")
        }
    )

    To load the saved selections when the app starts, add this to your Screen's OnVisible property:
    UpdateContext({
        savedDropdownValue: LookUp(SavedSelections, ControlName = "Dropdown1").SelectedItems,
        savedListboxValues: Split(LookUp(SavedSelections, ControlName = "Listbox1").SelectedItems, ",")
    });
    
    Set(
        Dropdown1.Selected,
        First(Filter(Dropdown1.Items, Value = savedDropdownValue))
    );
    
    Set(
        Listbox1.Selected,
        Filter(Listbox1.Items, Value in savedListboxValues)
    )

    Make sure to initialize the Excel table with at least one row for each control:
    • ControlName: "Dropdown1", SelectedItems: ""
    • ControlName: "Listbox1", SelectedItems: ""

    Let me know if this helps.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard