1 Reply Latest reply on May 3, 2016 6:54 PM by Jeff D

    Tableau Web Data Connector: Using a Switch Statement for Different Scenarios

    Christopher Spencer

      I built a web data connector for a social tool to bring back data via JSON. The JSON is formatted differently based on which category of data being accessed. I'm using a switch statement to define the Tableau field names and field types to bring back from the JSON file based on user input from a form field to build the query to send the social media tool. The problem is the switch statement isn't being evaluated in Tableau but does get evaluated in the simulator. The switch statement's text is being defined from a variable with a jQuery statement to pick up the user input from the drop down selection. To test I hardcoded the values which works with the switch statement.  Has this happend to anyone else? Why doesn't the switch statement work in Tableau if it works in the simulator? I know the simulator is different and all but it seems like a javascript switch statement should work the same in both.