tableau / extensions-api

Extensions API sample code and developer docs.
http://tableau.github.io/extensions-api
MIT License
268 stars 251 forks source link

Extension API crashes while extracting worksheet data #519

Closed mohit-rana85 closed 1 year ago

mohit-rana85 commented 1 year ago

Describe the issue

I am facing an issue related to tableau extension api. The api fails while extracting the worksheet data by using the methods getSummaryColumnsInfoAsync or getSummaryDataAsync.

Version information:

Steps to reproduce (please include a code snippet, if possible):

  1. Code: await worksheet.getSummaryColumnsInfoAsync().then(async colNames => { para1ColId = colNames.find(col => col.fieldName.toLowerCase() === 'para1').fieldId; para2ColId = colNames.find(col => col.fieldName.toLowerCase() === 'para2').fieldId; });
  2. Error; Cannot read property 'fieldId' of undefined
  3. In the debugging mode: Chromium shows an error: Debugging connection was closed. Reason: WebSocket disconnected.

A clear and concise description of what you expected to happen. I expect to get list of all columns in the worksheet and their corresponding colID.

Screenshots and workbook

If possible, attach a workbook with sample data add/or screenshots to help explain your problem.

NOTE: Be careful not to post user names, passwords, auth tokens or any other private or sensitive information.

johnDance commented 1 year ago

Hi @mohit-rana85 : It appears that the find did not find 'para1' or 'para2' in the column names. Can you put a breakpoint on the first colNames.find, and then look at the contents of colNames? You should be able to see if there is a fieldName in the array of para1 and para2.

If you would like you could dump colNames to the console and then look at the fieldId and fieldName of each of the columns in your summary data.

Let us know what you find. Thanks, John