Skip to main content

Notifications

Power Apps - Building Power Apps
Suggested answer

Dropdown Selection Not Changing When Variable Reference is Changed

Posted on 25 Nov 2024 16:51:30 by 10
Hello,
 
I have a dropdown field in a form with the default selected items referencing the value in a variable. It is pulling in the value, but when the variable changes throughout the form editing process, the dropdown does not change. It seems to only change after saving the form (and recording the previous value in the dropdown field).
 
Any ideas on how to resolve this?
 
Thank you!
  • Suggested answer
    SaiRT14 Profile Picture
    SaiRT14 1,216 on 25 Nov 2024 at 18:29:25
    Dropdown Selection Not Changing When Variable Reference is Changed
    pls try the following:
     
    Initialize the Variable: // On App Start Set(varSelectedValue, "InitialValue")
     
    Bind Dropdown's Default Property: Dropdown1.Default = varSelectedValue
    multi selection - Dropdown1.DefaultSelectedItems = Filter(Dropdown1.Items, Value in varSelectedValues)
     
    Update Variable and Reset Dropdown: // Example: Update on Button Click
    Button1.OnSelect = 
        Set(varSelectedValue, "NewValue");
        Reset(Dropdown1)
     
    Ensure Dropdown Items are Properly Structured: Dropdown1.Items = Choices(DataSource.ColumnName)
    // Or for custom items
    Dropdown1.Items = [ "Option1", "Option2", "Option3" ]
     
  • tjohnson2 Profile Picture
    tjohnson2 10 on 25 Nov 2024 at 17:39:12
    Dropdown Selection Not Changing When Variable Reference is Changed
    That solved it - thank you!
  • ronaldwalcott Profile Picture
    ronaldwalcott 855 on 25 Nov 2024 at 16:58:52
    Dropdown Selection Not Changing When Variable Reference is Changed
    What is the source of the items in the dropdown? What is the variable type (single item or record)? 
  • Suggested answer
    timl Profile Picture
    timl 31,946 on 25 Nov 2024 at 16:55:44
    Dropdown Selection Not Changing When Variable Reference is Changed
    To update the dropdown, you would need to reset it after updating the variable.  The formula would look like this:
     
    Set(varYourVariable, "New variable value");
    Reset(drpYourDropdownControl)
     

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,246

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,884

Leaderboard