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 / 2 Dropdowns, 1 Button ...
Power Apps
Answered

2 Dropdowns, 1 Button to go to different screens

(0) ShareShare
ReportReport
Posted on by 175

Hi Team,

 

I have two dropdowns (LOCATION and ITEMS). 

There is 4 locations and 2 items.

 

If I select Lutong Head Office AND Laptop, when I click on View button  it should go to Lutong's Laptop Screen

If I select Lutong Head Office AND Accessories, when I click on View button  it should go to Lutong's Accessory Screen

 

vikna_0-1619409599191.png

 

How can one button perform these multiple options?

Please advice.

 

Categories:
I have the same question (0)
  • Verified answer
    Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @vikna ,

    OnSelect of View button, Check condition as

    If( dropdown1.selected.Name = "Head Office" && dropdown2.selected.Name = "Accessories" , Navigate('Accessories Screen'), Navigate('Laptop Screen') )

     

    Hope this helps

  • vikna Profile Picture
    175 on at

    Hi @Ethan_R 

    That worked.. thank you very much!!!

     

    I have another additional question.

     

    I have 3 other locations in the dropdown menu for example, Malaysia, Singapore and Thailand

    AND items are the same which is laptop and accessories.

     

    how do I modify if I select different locations as well?

     

    really appreciate it !

    Thanks!

     

     

     

     

  • vikna Profile Picture
    175 on at

    .

  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @vikna ,

    Try using updateContext variables to check Location and Items and then Navigate

    or else try nested If condition (avoid if there are many values) and then Navigate

    Hope this will help

  • vikna Profile Picture
    175 on at

    let me check it out if I know how to do that. thanks

  • vikna Profile Picture
    175 on at

    so far failed to find a solution. I am not very good in coding.

    Appreciate it if can assist with the solution. 😞

  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @vikna ,

    It would look tricky but there can be multiple approach.

    I've kinda did something to look good and work relatively better as per records 

     

    If( DD2.Selected.Name = "Malaysia", updateContext({varLocation: "Malaysia"}) , 
    	If( DD2.Selected.Name = "Thailand", updateContext({varLocation: "Thailand"}) ,
    		If( DD2.Selected.Name = "Singapore", updateContext({varLocation: "Singapore"})
    		)
    	)
    )
    If( DD1.Seleted.Name = "Laptop", updateContext({varItems: "Laptop"}), updateContext({varItems: "Accessories"}) )
    
    If( varItems = "Laptop", If(varLocation = "Malaysia", Navigate('Malaysia Laptop Screen'),
    	If(varLocation = "Thailand", Navigate('Thailand Laptop Screen'),
    		If(varLocation = "Singapore", Navigate('Singapore Laptop Screen')
    		)
    	)
    )
    If( varItems = "Accessories", If(varLocation = "Malaysia", Navigate('Malaysia Accessories Screen'),
    	If(varLocation = "Thailand", Navigate('Thailand Accessories Screen'),
    		If(varLocation = "Singapore", Navigate('Singapore Accessories Screen')
    		)
    	)
    )

     Hope this helps

  • vikna Profile Picture
    175 on at

    I'm seeing the below two errors.

     

    vikna_0-1619422877477.png

     

     

    vikna_1-1619422909558.png

     

    and again...thank you so much for taking the time to assist me. 🙂

  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @vikna ,

    Try adding ; (Semi -colon) after end of each If Condition.

     

    This might help

  • vikna Profile Picture
    175 on at

    vikna_0-1619486179705.png

    It's still the same. 

     

    However, I tried the below with your first code : 

    vikna_1-1619486360137.png

     

    No errors has been generated BUT ALL accessories selection goes to the last one which is LSB Accessories.

    Laptop works fine.  

    Is it possible to refine on this instead?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 846

#2
Valantis Profile Picture

Valantis 532

#3
Haque Profile Picture

Haque 410

Last 30 days Overall leaderboard