cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Issues with Switch formula and drop down

I want to send the end users to a different screen based on the selection made in the dropdown box. I have configured the dropdown box with 7 choices and am trying to apply this formula:

 

Switch(SiteSelection.Value, Blaine, Navigate(Blaine, ScreenTransition.None ), Canada, Navigate(Canada, ScreenTransition.None ), Japan, Navigate( Japan, ScreenTransition.None ), Melville, Navigate( Melville, ScreenTransition.None ), Northtec, Navigate( Northtec, ScreenTransition.None ), Oevel, Navigate( Oevel, ScreenTransition.None ), Whitman, Navigate( Whitman, ScreenTransition.None ) )

 

to the Next button in the Action>OnSelect area.

 

The issue I am running into seems to be with the SiteSelection.Value statement. I have tried Text, Item and Items in place of Value with no success. I also tried SiteSelection.Selected.Value and subbing in Text, item and Items with no success. SiteSelection is the name of my drop down. Going by the tutorial found here:

 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-if

 

my formula should work. Can anyone tell me what I am doing wrong?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Issues with Switch formula and drop down

Hi @kohrt ,

 

Could you share the items property of your drop down?

If the items of dropdown are text and the field is Value, you should use SiteSelection.Selected.Value to call the selected value.

On the other hand, it seems you forget the "" on these match values, i.e Blaine, Canada,Japan, etc.

so please modify your formula as below:

Switch(SiteSelection.Value, "Blaine", Navigate(Blaine, ScreenTransition.None ), "Canada", Navigate(Canada, ScreenTransition.None ), "Japan", Navigate( Japan, ScreenTransition.None ), "Melville", Navigate( Melville, ScreenTransition.None ), "Northtec", Navigate( Northtec, ScreenTransition.None ), "Oevel", Navigate( Oevel, ScreenTransition.None ), "Whitman", Navigate( Whitman, ScreenTransition.None ) )

Hope this helps.

Best regards,

Sik

If my post is helpful for you, please click on “Accept as Solution” to help other members find it more quickly.

View solution in original post

5 REPLIES 5
Highlighted
Solution Supplier
Solution Supplier

Re: Issues with Switch formula and drop down

is it a typo in your formula here the you didn't put the site values in double quotation marks? "Canada" , "Japan" , ...

and you should use SiteSelection.Selected.Value

Highlighted
Community Support
Community Support

Re: Issues with Switch formula and drop down

Hi @kohrt ,

 

Could you share the items property of your drop down?

If the items of dropdown are text and the field is Value, you should use SiteSelection.Selected.Value to call the selected value.

On the other hand, it seems you forget the "" on these match values, i.e Blaine, Canada,Japan, etc.

so please modify your formula as below:

Switch(SiteSelection.Value, "Blaine", Navigate(Blaine, ScreenTransition.None ), "Canada", Navigate(Canada, ScreenTransition.None ), "Japan", Navigate( Japan, ScreenTransition.None ), "Melville", Navigate( Melville, ScreenTransition.None ), "Northtec", Navigate( Northtec, ScreenTransition.None ), "Oevel", Navigate( Oevel, ScreenTransition.None ), "Whitman", Navigate( Whitman, ScreenTransition.None ) )

Hope this helps.

Best regards,

Sik

If my post is helpful for you, please click on “Accept as Solution” to help other members find it more quickly.

View solution in original post

Highlighted
Frequent Visitor

Re: Issues with Switch formula and drop down

Thanks for your reply. The Items Data is: ["Blaine","Canada","Japan","Melville","Northtec","Oevel","Whitman"] and the drop down seems to work fine. The Value is set to Value.

 

I changed to formula as you suggested above (I did have the quotes in there at first and I forgot to mention I took them out when i was trying different iterations). I tried:

 

Switch(SiteSelection.Selected.Value, "Blaine", Navigate(Blaine, ScreenTransition.None ), "Canada", Navigate(Canada, ScreenTransition.None ), "Japan", Navigate( Japan, ScreenTransition.None ), "Melville", Navigate( Melville, ScreenTransition.None ), "Northtec", Navigate( Northtec, ScreenTransition.None ), "Oevel", Navigate( Oevel, ScreenTransition.None ), "Whitman", Navigate( Whitman, ScreenTransition.None ) )

 

And:

 

Switch(SiteSelection.Value, "Blaine", Navigate(Blaine, ScreenTransition.None ), "Canada", Navigate(Canada, ScreenTransition.None ), "Japan", Navigate( Japan, ScreenTransition.None ), "Melville", Navigate( Melville, ScreenTransition.None ), "Northtec", Navigate( Northtec, ScreenTransition.None ), "Oevel", Navigate( Oevel, ScreenTransition.None ), "Whitman", Navigate( Whitman, ScreenTransition.None ) )

 

Do I have something entered incorrectly?

Highlighted
Frequent Visitor

Re: Issues with Switch formula and drop down

Yes, I took out the quotes when I was trying to fix the issue and forgot to add them back in. As mentioned in my post I have also tried SiteSelection.Selected.Value and it will not work. I replied to someone else with the Item properties as well as an updated formula but it is still not working.

Highlighted
Frequent Visitor

Re: Issues with Switch formula and drop down

Fixed - I deleted everything and tried again from scratch and your solution with the SiteSelection.Selected.Value worked this time.

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,532)