---
schema_version: "1"
id: 093e5538aa4316fcc0430249e655eb4fcc4b1bf25d39f78821e26ea2269400e8
title: Get Data Source Model
collection: tableau
version: current
locale: en-us
portal_url: https://docs.salesforce.com/tableau/current/en-us/api/vizql-data-service/docs/vds_get_data_source_model.md
canonical_url: https://help.tableau.com/current/api/vizql-data-service/en-us/docs/vds_get_data_source_model.html
source_site: help.tableau.com
content_type: documentation
content_hash: 29efe36871949e2e81138054c7a002afcf9e1a6af129adf04f31062b7eaf8c2f
description: Documentation for the VizQL Data Service
---
# Get Data Source Model

  

🕐 _2 min read_

## Get the data model in the data source

The [Request data source model](https://help.tableau.com/current/api/vizql-data-service/en-us/reference/index.html#operation/GetDatasourceModel) 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](https://help.tableau.com/current/api/vizql-data-service/en-us/docs/vds_configuration.html#find-the-data-source-luid).

```
{
    "datasource": {
        "datasourceLuid": "1a2a3b4b-5c6c-7d8d-9e0e-1f2f3a4a5b6b",
    }
}
```

**Note**: While the VDS schema indicates that `workbookDatasourceId` is a valid `datasource` for the `get-datasource-model` method, it is not supported.

The request has the following options:

- `bypassMetadataCache`: Set to `true` if either the published data source or the underlying database has changed within your current session. When set to `true`, 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 to `true` to request a new session. Clears the cached session for the user before a new session is created.
- `interpretFieldCaptionsAsFieldNames`: When set to `true`, the response returns the `fieldName` value everywhere the `fieldCaption` is used. This is also true for parameters. For example, if you set this field to `true`, the response returns, for example, `Parameter 2` instead of `Profit Bin Size`.
- `includeHiddenFields`: When set to `true`, the response shows hidden fields.
- `includeGroupFormulas`: When set to `true`, 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:

![Data model graph](/tableau/current/en-us/api/vizql-data-service/en-us/assets/vds-data-model.png)

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](https://help.tableau.com/current/online/en-us/datasource_datamodel.htm).