🕐 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, which is the datasourceLuid for a published data source. To find the datasourceLuid, see Find the data source LUID.
{
"datasource": {
"datasourceLuid": "1a2a3b4b-5c6c-7d8d-9e0e-1f2f3a4a5b6b",
}
}
workbookDatasourceId is a valid datasource for the get-datasource-model method, it is not supported.
The request has the following options:
-
bypassMetadataCache: Set totrueif either the published data source or the underlying database has changed within your current session. When set totrue, VizQL Data Service (VDS) refreshes the metadata. Note that VDS automatically invalidates the cache when the data source is republished. Use this option if your underlying database has changed. -
withNewSession: Set totrueto request a new session. Clears the cached session for the user before a new session is created. -
interpretFieldCaptionsAsFieldNames: When set totrue, the response returns thefieldNamevalue everywhere thefieldCaptionis used. This is also true for parameters. For example, if you set this field totrue, the response returns, for example,Parameter 2instead ofProfit Bin Size. -
includeHiddenFields: When set totrue, the response shows hidden fields. -
includeGroupFormulas: When set totrue, the response shows the group information for fields that are categorical bins.
Request data source model response
This API method returns two objects: logicalTables and logicalTableRelationships. The logicalTables object returns these fields:
logicalTableId: The logical table LUID.caption: The user-defined logical table display name.
The logicalTableRelationships object returns these fields:
fromLogicalTable: Contains the key:value pair for LUID of the table on the left.toLogicalTable: Contains the key:value pair for LUID of the table on the right.
Example output
For this example, let’s use a data source with the following model in the Tableau user interface:

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.