Switch Statement for List control
I am trying to perform a switch statement on a selectable list. My list items are names that change based on a search. After the search, the list contains only one list item corresponding to the search. I then need to navigate to the appropriate page based on the name on the list item. The code I have below is not working. Any help would be much appreciated.
var screenName = "";
switch(location) //location is the name of my list control
{
case "John Doe": //"John Doe" being the name that would be on list item
{
screenName = "John_Doe"; //already existing page names
break;
}
case "Mike Smith":
{
screenName = "Mike_Smith";
break;
}
}
Apperyio.navigateTo(screenName);