4 Replies Latest reply on Mar 7, 2018 8:01 AM by patrick.byrne.0

    Getting a viz selection?

    Nat Greenwald

      Hello,

      I have a requirement where I want to get the underlying data of a viz (with a user's selection), however I can't allow the client to call getUnderlyingDataAsync() because I can't give the client those permissions (due to some security requirements).

      So I want to getUnderlyingDataAsync server side (ie, in Node), or at the least be able to identify the user's selection to do the filtering in another way.

      I have spent the last few days trying to understand the internals of getUnderlyingDataAsync and the worksheet object to understand how to get the selection.

       

      Can anyone point me in the right direction to obtain the selection of a worksheet?

       

      Thanks,

      Nat

        • 1. Re: Getting a viz selection?
          patrick.byrne.0

          Hi Nat,

           

          Based on the reference in the API Reference manual, found here: API Reference , I believe you need to call the 'Summary Data Table' to be returned.

           

          DataTable Class

          When you call the getSummaryDataAsync or getUnderlyingDataAsync methods on a worksheet, Tableau Server returns a DataTable object.

          Methods

          Name

          Return Type

          Description

          getName()

          str

          Either "Underlying Data Table" or "Summary Data Table".

          getData()arrayA two-dimensional array of data without the sheet or column metadata. The first array index is the row index and the second array index is the column index.
          getColumns()array<Column>The column information, including the name, data type, and index.
          getTotalRowCount()intThe number of rows in the returned data.
          getIsSummaryData()boolWhether the data is summary data or underlying data. Returns true for summary data.

           

          Hope this helps!

           

          Cheers,

          Byrne, Patrick

          • 2. Re: Getting a viz selection?
            Nat Greenwald

            getSummaryDataAsync has the same permissions requirement as getUnderlyingDataAsync, which I need to disable for the user.

             

            I'm interested in understanding the internals of getUnderlyingDataAsync, so I can identify the user's selection and send it to a separate service with the right permissions to get the associated data.

            That is, how does getUnderlyingDataAsync know the user's selection? How can I get the selection?

            • 3. Re: Getting a viz selection?
              Nat Greenwald

              getSelectedMarksAsync may be a solution, in that it gets the visible data, but not all of the columns in the data source. It may be able to be combined with an API to get the other values that getUnderlingDataAsync does.

              • 4. Re: Getting a viz selection?
                patrick.byrne.0

                Sorry for the delay in my reply. I am going to dig around some more to see if I can find some additional information on the use of the getUnderlyingDataAsync.

                 

                Cheers,

                Byrne, Patrick