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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Function of If stateme...
Power Apps
Suggested Answer

Function of If statement for dropdown based on the previous dropdown selection

(0) ShareShare
ReportReport
Posted on by 4
Hi Community!
 
I have to build two dropdown of which if the first dropdown is "A" then the second dropdown will set as "E"
 
The list of the first drop down:
A
B
C
D
 
The second dropdown based on selection :
A = E
B = F
C = G
D = H
 
How do we do this? and where to set it?
Categories:
I have the same question (0)
  • Suggested answer
    Nandit Profile Picture
    1,568 Moderator on at
     
    To achieve this, you can make use of the Switch statement in the DefaultSelectedItems property of the second dropdown. 
     
    Items property of the First Dropdown:
    ["A", "B", "C", "D"]
    Items property of the second Dropdown:
    ["E", "F", "G", "H"]
     
    Here is the DefaultSelectedItems property of the Second Dropdown:
    Switch(
        firstdrpdown.Selected.Value,
        "A",
        ["E"],
        "B",
        ["F"],
        "C",
        ["G"],
        "D",
        ["H"]
    )
    Here's how it looks:
     
    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!
  • NH-09100837-0 Profile Picture
    4 on at
    Hi @nandit,
     
    It throw me an error. I might look noob here but may I know where do you put the switch statement? I dont find DefaultSelectedItems property. 
     
  • Suggested answer
    Ravindra Jadhav Profile Picture
    342 Moderator on at

    using the Switch function in Power Fx, We Can Achive this

    1. Set the Items property of the second dropdown based on the first dropdown selection:

    In the OnChange property of the first dropdown (let’s call it Dropdown1):

    Switch(
    Dropdown1.Selected.Value,
    "A", "E",
    "B", "F",
    "C", "G",
    "D", "H",
    ""
    )
    
    Set the Items property of the second dropdown (let’s call it Dropdown2) to this formula:
    
    Table({Value: Switch(Dropdown1.Selected.Value, "A", "E", "B", "F", "C", "G", "D", "H")})
     
    Please Closed the Question, Mark it Solved 
     
    If my answer helped resolve your issue, please consider marking it as solved to assist others facing the same problem. Additionally, giving it a like would be greatly appreciated and motivates us to keep helping
     
    Thank You
    Ravindra Jadhav

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 339 Most Valuable Professional

#2
11manish Profile Picture

11manish 180

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard