Retrieving embedded datasource's custom SQL with Tableau API

Viewed 400

I'm trying to use Tableau's APIs (Metadata GraphQL and REST) to get information about workbook's embedded datasources.

A workbook has embedded datasources, and there's no issue retrieving that info, the problem occurs when an embedded datasource has extracts which are performed using a custom SQL.

Has anyone been able to retrieve the link between the embedded datasource and the custom SQL that creates it? Either GraphQL or REST API is fine.

Thanks!

1 Answers

Below query might be useful. It's worth adding a filter to the data source level. I have the experience that MetaData Api doesn't able to capture the content of all Custom Queries. I'm not sure why.

query EmbeddedDS{
  embeddedDatasources{
      DSname: name
      fields{
        fieldName: name
         ...on ColumnField{
          columns{
            table{
              ...on CustomSQLTable{
                CustomSQL: name
                query
              }
            }
          }
        }
      }
    }
  }
Related