> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://help.sigmacomputing.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://help.sigmacomputing.com/_mcp/server.

# Example representation: Data model with a CSV table

> Example Sigma code representation of a data model with a CSV table.

This is an example representation of a data model, created using the [get a data model representation](/reference/getdatamodelspec) endpoint. Representations like this one can be used to create a data model from code using the [create a data model from a representation](/reference/createdatamodelspec) endpoint. Each page in this example library includes the code representation of the data model and step-by-step instructions to create it in the Sigma UI.

Consult this example and others in the [Data model representation example library](/docs/data-model-representation-example-library) to:

* Troubleshoot the formatting of a particular feature in code representation
* Relate a feature from the Sigma UI to its representation in code
* Provide context to AI tools used to create data models from code

This example representation cannot be used as-is. All identifying details, such as IDs, names, and URLs, have been replaced with randomized ID values or generic substitutions. The format of these contents, like the length of ID values, is preserved for demonstrative purposes. However, this representation cannot be directly used without modification to the base URL, connection details, and more. For more information, see [Create and manage data models from code](/docs/manage-data-models-as-code).

## System and user requirements

To complete the steps in this example, you must meet the user requirements listed below for creating the data model in the UI and creating it from code.

The ability to create this data model in the Sigma UI requires the following:

* You must be assigned an [account type](/docs/account-type-and-license-overview) with the **Create, edit, and publish data models** and **Upload CSV** permissions enabled.
* You must have access to a connection with [write access](/docs/set-up-write-access) enabled. Sigma writes uploaded CSV data to this connection.
* The [CSV upload](/docs/configure-csv-upload-and-storage-options) feature must be enabled for your organization.

The ability to create a data model from code requires the following:

* You must be assigned the **Admin** [account type](/docs/account-type-and-license-overview).
* You must have developer credentials for the Sigma API. For more information, see [Get started with the Sigma REST API](/reference/get-started-sigma-api).

This example uses a table from the [Sigma Sample Connection](/docs/sigmas-sample-connection). Your organization might have disabled access to the Sigma sample connection. If so, you can contact an admin to enable it, or use a table from another connection to follow along with this example.

## Create the example data model in the Sigma UI

This example shows a simple data model with a single table element sourced from an uploaded CSV file. The example uses a file named `TRIP.csv` that contains the 11 columns of the `TRIP` table in the `FUN.BIKES` schema. To follow along with the same data, export that table to a CSV file, or upload a CSV file of your own.

To create this data model in the Sigma UI:

1. Go to the **Home** page.

2. Select ![](https://sigma-docs-screenshots.s3.us-west-2.amazonaws.com/Icons/button-add.svg) **Create New** > **Data model**.

   A new data model opens.

3. From the **Add element** bar, select **Data** > **Table**.

4. In the **Select source** modal, select **CSV**.

5. In the **Upload CSV** page, select the **Connection** dropdown and choose a connection to write the CSV data to. You can only choose a connection with write access enabled.

6. Drag and drop the `TRIP.csv` file, or click **Browse** and choose it from the file picker.

   Sigma displays a preview of the data.

7. In the **Results** tab, review the parsed data and confirm that all 11 columns are included.

8. In the header, click **Save**.

   The CSV data appears as a table element in the data model.

9. Select **Publish**.

For more information about uploading CSV data and customizing parsing options, see [Upload CSV data](/docs/upload-csv-data).

## Get a JSON representation of this data model

To get a JSON representation of this data model, follow the steps in [Get the code representation of a data model](/docs/get-the-code-representation-of-a-data-model).

The JSON representation of this data model appears like the following:

#### JSON representation

```json
{
  "dataModelId": "16b7560c-735b-4849-9558-6124738030ba",
  "name": "csv-table",
  "url": "https://aws-api.sigmacomputing.com/org-name/data-model/csv-table-i4iV44p1P25Glqn9Mq2gpl",
  "documentVersion": 2,
  "latestDocumentVersion": 2,
  "ownerId": "k44hlkTl6jwvpvBPvwtiKHbF8Eezc",
  "folderId": "835de47c-2e44-4d87-aaff-5912eb405d7f",
  "createdBy": "k44hlkTl6jwvpvBPvwtiKHbF8Eezc",
  "updatedBy": "k44hlkTl6jwvpvBPvwtiKHbF8Eezc",
  "createdAt": "2026-09-03T16:21:53.877Z",
  "updatedAt": "2026-09-03T16:23:12.209Z",
  "schemaVersion": 1,
  "pages": [
    {
      "id": "sSoGwH4D6y",
      "name": "Page 1",
      "elements": [
        {
          "id": "Ph6VpWECZg",
          "kind": "table",
          "source": {
            "connectionId": "9b32627e-8b6e-4535-81be-dbd0c9608306",
            "kind": "csv-table",
            "inodeId": "bd78491c-c9a6-443a-b1de-e06d075c45a4"
          },
          "columns": [
            {
              "id": "bd78491c-c9a6-443a-b1de-e06d075c45a4/ID",
              "formula": "[TRIP.csv/Id]"
            },
            {
              "id": "bd78491c-c9a6-443a-b1de-e06d075c45a4/DURATION",
              "formula": "[TRIP.csv/Duration]"
            },
            {
              "id": "bd78491c-c9a6-443a-b1de-e06d075c45a4/START_DATE",
              "formula": "[TRIP.csv/Start Date]"
            },
            {
              "id": "bd78491c-c9a6-443a-b1de-e06d075c45a4/START_STATION_NAME",
              "formula": "[TRIP.csv/Start Station Name]"
            },
            {
              "id": "bd78491c-c9a6-443a-b1de-e06d075c45a4/START_STATION_ID",
              "formula": "[TRIP.csv/Start Station Id]"
            },
            {
              "id": "bd78491c-c9a6-443a-b1de-e06d075c45a4/END_DATE",
              "formula": "[TRIP.csv/End Date]"
            },
            {
              "id": "bd78491c-c9a6-443a-b1de-e06d075c45a4/END_STATION_NAME",
              "formula": "[TRIP.csv/End Station Name]"
            },
            {
              "id": "bd78491c-c9a6-443a-b1de-e06d075c45a4/END_STATION_ID",
              "formula": "[TRIP.csv/End Station Id]"
            },
            {
              "id": "bd78491c-c9a6-443a-b1de-e06d075c45a4/BIKE_ID",
              "formula": "[TRIP.csv/Bike Id]"
            },
            {
              "id": "bd78491c-c9a6-443a-b1de-e06d075c45a4/SUBSCRIPTION_TYPE",
              "formula": "[TRIP.csv/Subscription Type]"
            },
            {
              "id": "bd78491c-c9a6-443a-b1de-e06d075c45a4/ZIP_CODE",
              "formula": "[TRIP.csv/Zip Code]"
            }
          ],
          "order": [
            "bd78491c-c9a6-443a-b1de-e06d075c45a4/ID",
            "bd78491c-c9a6-443a-b1de-e06d075c45a4/DURATION",
            "bd78491c-c9a6-443a-b1de-e06d075c45a4/START_DATE",
            "bd78491c-c9a6-443a-b1de-e06d075c45a4/START_STATION_NAME",
            "bd78491c-c9a6-443a-b1de-e06d075c45a4/START_STATION_ID",
            "bd78491c-c9a6-443a-b1de-e06d075c45a4/END_DATE",
            "bd78491c-c9a6-443a-b1de-e06d075c45a4/END_STATION_NAME",
            "bd78491c-c9a6-443a-b1de-e06d075c45a4/END_STATION_ID",
            "bd78491c-c9a6-443a-b1de-e06d075c45a4/BIKE_ID",
            "bd78491c-c9a6-443a-b1de-e06d075c45a4/SUBSCRIPTION_TYPE",
            "bd78491c-c9a6-443a-b1de-e06d075c45a4/ZIP_CODE"
          ]
        }
      ]
    }
  ],
  "kind": "data-model"
}
```

## Representing CSV tables

In this representation, the CSV table is represented by this object in the `elements` array of the data model:

#### CSV table representation

```json
...
{
  "id": "Ph6VpWECZg",
  "kind": "table",
  "source": {
    "connectionId": "9b32627e-8b6e-4535-81be-dbd0c9608306",
    "kind": "csv-table",
    "inodeId": "bd78491c-c9a6-443a-b1de-e06d075c45a4"
  },
  "columns": [
    {
      "id": "bd78491c-c9a6-443a-b1de-e06d075c45a4/ID",
      "formula": "[TRIP.csv/Id]"
    },
    {
      "id": "bd78491c-c9a6-443a-b1de-e06d075c45a4/DURATION",
      "formula": "[TRIP.csv/Duration]"
    },
    {
      "id": "bd78491c-c9a6-443a-b1de-e06d075c45a4/START_DATE",
      "formula": "[TRIP.csv/Start Date]"
    },
    {
      "id": "bd78491c-c9a6-443a-b1de-e06d075c45a4/START_STATION_NAME",
      "formula": "[TRIP.csv/Start Station Name]"
    },
    {
      "id": "bd78491c-c9a6-443a-b1de-e06d075c45a4/START_STATION_ID",
      "formula": "[TRIP.csv/Start Station Id]"
    },
    {
      "id": "bd78491c-c9a6-443a-b1de-e06d075c45a4/END_DATE",
      "formula": "[TRIP.csv/End Date]"
    },
    {
      "id": "bd78491c-c9a6-443a-b1de-e06d075c45a4/END_STATION_NAME",
      "formula": "[TRIP.csv/End Station Name]"
    },
    {
      "id": "bd78491c-c9a6-443a-b1de-e06d075c45a4/END_STATION_ID",
      "formula": "[TRIP.csv/End Station Id]"
    },
    {
      "id": "bd78491c-c9a6-443a-b1de-e06d075c45a4/BIKE_ID",
      "formula": "[TRIP.csv/Bike Id]"
    },
    {
      "id": "bd78491c-c9a6-443a-b1de-e06d075c45a4/SUBSCRIPTION_TYPE",
      "formula": "[TRIP.csv/Subscription Type]"
    },
    {
      "id": "bd78491c-c9a6-443a-b1de-e06d075c45a4/ZIP_CODE",
      "formula": "[TRIP.csv/Zip Code]"
    }
  ],
  "order": [
    "bd78491c-c9a6-443a-b1de-e06d075c45a4/ID",
    "bd78491c-c9a6-443a-b1de-e06d075c45a4/DURATION",
    "bd78491c-c9a6-443a-b1de-e06d075c45a4/START_DATE",
    "bd78491c-c9a6-443a-b1de-e06d075c45a4/START_STATION_NAME",
    "bd78491c-c9a6-443a-b1de-e06d075c45a4/START_STATION_ID",
    "bd78491c-c9a6-443a-b1de-e06d075c45a4/END_DATE",
    "bd78491c-c9a6-443a-b1de-e06d075c45a4/END_STATION_NAME",
    "bd78491c-c9a6-443a-b1de-e06d075c45a4/END_STATION_ID",
    "bd78491c-c9a6-443a-b1de-e06d075c45a4/BIKE_ID",
    "bd78491c-c9a6-443a-b1de-e06d075c45a4/SUBSCRIPTION_TYPE",
    "bd78491c-c9a6-443a-b1de-e06d075c45a4/ZIP_CODE"
  ]
}
...
```