cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
kohrt
Level: Powered On

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
Microsoft v-siky-msft
Microsoft

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
Edwin-Abdalian
Level 10

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

Microsoft v-siky-msft
Microsoft

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

kohrt
Level: Powered On

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?

kohrt
Level: Powered On

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.

kohrt
Level: Powered On

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
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (7,608)