3 Replies Latest reply on Apr 4, 2017 5:46 PM by anton.avguchenko

    tableau.connectionData is not an object!

    anton.avguchenko

      The API reference incorrectly states that tableau.connectionData is an object.

      It is not.

      It is a string.

       

      You can create an object and pass it it into tableau.connectionData with JSON.stringify():

      var myConnectionData = {
           coolThing1: "so cool",
           coolThing2: "kinda cool"
      }
      myConnectionData.coolthing3 = "the coolest"
      
      //now give it to tableau
      tableau.connectionData = JSON.stringify(myConnectionData)
      
      //now make it into an object again
      var myConnectionStuff = JSON.parse(tableau.connectionData)