Get Data Source Information


🕐 3 min read

Find the data source LUID

To run a query, you must know the locally unique identifier (LUID) of the data source you’re requesting information about. There are two options for finding the data source name.

Option 1: Get the name from the URL when editing the data source

Select the Edit Data Source button. A new tab displays showing the data source name in the URL. For example:

https://10ax.online.tableau.com/t/<site_name>/editDatasource/<luid>/<DATASOURCE_NAME>#1

Option 2: Use the Tableau REST API

Use the Query Data Sources method to return a list of data sources on your site. This method returns the official data source name in the contentURL attribute.

Get the data structure in the data source

The Request data source metadata method provides you with additional information about the queryable fields in a data source. This method requires that you pass in the data source object, as shown in the following example.

{
    "datasource": {
        "datasourceLuid": "",
    }
}

Request data source metadata output

This API endpoint returns a list of fields with:

Example output

{
    "data": [
        {
            "fieldName": "Calculation_1368249927221915648",
            "fieldCaption": "Profit Ratio",
            "dataType": "REAL",
            "logicalTableId": ""
        },
        {
            "fieldName": "Category",
            "fieldCaption": "Category",
            "dataType": "STRING",
            "logicalTableId": "Orders_ECFCA1FB690A41FE803BC071773BA862"
        },
        {
            "fieldName": "City",
            "fieldCaption": "City",
            "dataType": "STRING",
            "logicalTableId": "Orders_ECFCA1FB690A41FE803BC071773BA862"
        }
]