Get Data Source Model


🕐 2 min read

Get the data model in the data source

The Request data source model method provides you with the logical table and relationship metadata in a published data source. This method requires that you pass in the data source object, as shown in this example:

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

Request data source model response

This API method returns two objects: logicalTables and logicalTableRelationships. The logicalTables object returns these fields:

The logicalTableRelationships object returns these fields:

Example output

For this example, let’s use a data source with the following model in the Tableau user interface:

Data model graph

A request to this data source returns the following response:

{
    "logicalTables": [
        {
            "logicalTableId": "Orders_ECFCA1FB690A41FE803BC071773BA862",
            "caption": "Orders"
        },
        {
            "logicalTableId": "People_D73023733B004CC1B3CB1ACF62F4A965",
            "caption": "People"
        },
        {
            "logicalTableId": "Returns_2AA0FE4D737A4F63970131D0E7480A03",
            "caption": "Returns"
        }
    ],
    "logicalTableRelationships": [
        {
            "fromLogicalTable": {
                "logicalTableId": "Orders_ECFCA1FB690A41FE803BC071773BA862"
            },
            "toLogicalTable": {
                "logicalTableId": "People_D73023733B004CC1B3CB1ACF62F4A965"
            }
        },
        {
            "fromLogicalTable": {
                "logicalTableId": "Orders_ECFCA1FB690A41FE803BC071773BA862"
            },
            "toLogicalTable": {
                "logicalTableId": "Returns_2AA0FE4D737A4F63970131D0E7480A03"
            }
        }
    ]
}

For more information, see The Tableau Data Model.