Skip to main content

Notifications

Power Platform Community / Forums / Building Power Apps / How do I set the value...
Building Power Apps
Answered

How do I set the value of a dropdown based on the value of a previous dropdown control?

Posted on by 268
I have three dropdowns (SharePoint Choice columns), and I want to set the value of the third one based on the selections on the first two. 
 
When a user selects "Yes" from the first dropdown, or selects "Maybe" from the second dropdown, I want to set the value of col3 to "N/A". Right now in the OnSelect of col2, I am doing something like this
If(DataCardValue2.Selected.Value = "Yes" Or DataCardValue3.Selected.Value = "Maybe", DataCardValue4.Selected.Value = "N/A", "")
This does not work. How do I set the value of this third dropdown?
Categories:
  • Suggested answer
    markperrah Profile Picture
    markperrah 24 on at
    How do I set the value of a dropdown based on the value of a previous dropdown control?
    All three drop downs Items:
    ["Yes","No","Maybe","N/A"]
     
    First and second dropdown onChange:
    Reset(dd_Third)
     
    Default for third dropdown:
    If(dd_first.Selected.Value = "Yes" || dd_Second.Selected.Value = "Maybe", "N/A", Blank())
     
    This set up seems to work on my test app.
  • Verified answer
    Spawn10 Profile Picture
    Spawn10 268 on at
    How do I set the value of a dropdown based on the value of a previous dropdown control?
    this approach worked for me. I put the following in the OnChange of both my dropdowns (col1 & col2) as well as the DefaultSelectedItems of col3 
    If(DataCardValue2.Selected.Value = "Yes" Or DataCardValue3.Selected.Value = "Maybe", LookUp(Choices(myList.col3),Value = "N/A"))
     
  • Spawn10 Profile Picture
    Spawn10 268 on at
    How do I set the value of a dropdown based on the value of a previous dropdown control?
    Hi @Nandit,
    Thanks for the response.
    When I put this in the default property of my third dropdown, I get this error...
     
     
    ...but this does not give me any error
     
    However, the third dropdown still isn't displaying the desired outcome. Also, I don't see the AllowEmptySelection as a property for my dropdown. 
  • Suggested answer
    Nandit Profile Picture
    Nandit 370 on at
    How do I set the value of a dropdown based on the value of a previous dropdown control?
    Hi Spawn10,
     
    You will have to update the Default property of your 3rd DropDown. 
    If(
        DataCardValue2.Selected.Value = "Yes" || DataCardValue3.Selected.Value = "Maybe",
        "N/A",
        Blank()
    )
    Update AllowEmptySelection property to true
     
    Hope this helps.
     
    Kind regards, 
    Nandit

    If this answers your query, please mark this response as the answer.
    If its helpful, please leave a like. Thanks!
     

Helpful resources

Quick Links

Welcome to the Power Platform…

We are thrilled to unveil the newly-launched Power Platform Communities!…

Community Update Sept 16…

Power Platform Community Update…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 140,745

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,355

Leaderboard