> 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 column-level security

> Example Sigma code representation of a data model with column-level security.

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** permissions enabled.
* You must have access to a connection to a data platform.

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

To create this data model in the Sigma UI:

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

2. Select <img src="https://sigma-docs-screenshots.s3.us-west-2.amazonaws.com/Icons/button-add.svg" alt="" /> **Create New** > **Data model**.

   A new data model opens.

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

4. In the **Select source** modal, search for the `FIVETRAN_LOG__AUDIT_TABLE` table in the `APPLICATIONS.FIVETRAN_LOG` schema and select it.

   The table appears on the workbook canvas.

5. Select the table.

6. In the editor panel, under **Modeling**, select <img src="https://sigma-docs-screenshots.s3.us-west-2.amazonaws.com/Icons/add.svg" alt="" /> **Add column security...**.

7. In the **Column security** modal, configure the following settings:

   |                        |                             |
   | :--------------------- | :-------------------------- |
   | **Restricted columns** | Select **Table Name**.      |
   | **Criteria**           | Select **No one can view**. |

8. Select **Publish**.

## 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": "47405220-c6a9-4544-b828-84fdf9b606d9",
  "name": "column-level-security",
  "url": "https://aws-api.sigmacomputing.com/org-name/data-model/column-level-security-WBPAYhBO2s7pLp9fGjZbtr",
  "documentVersion": 2,
  "latestDocumentVersion": 2,
  "ownerId": "fOsrWKBxSMe8HqLmT0nXESkGLpkIc",
  "folderId": "fcb10706-125c-4a83-83d1-2977c8d963a0",
  "createdBy": "fOsrWKBxSMe8HqLmT0nXESkGLpkIc",
  "updatedBy": "fOsrWKBxSMe8HqLmT0nXESkGLpkIc",
  "createdAt": "2026-03-24T21:22:41.882Z",
  "updatedAt": "2026-03-24T22:02:07.588Z",
  "schemaVersion": 1,
  "pages": [
    {
      "id": "LQph4qd1Vd",
      "name": "Page 1",
      "elements": [
        {
          "id": "c4ZrWLjYZR",
          "kind": "table",
          "source": {
            "connectionId": "9ad28df9-5f5f-4bae-8985-bb12d25829de",
            "kind": "warehouse-table",
            "path": [
              "APPLICATIONS",
              "FIVETRAN_LOG",
              "FIVETRAN_LOG__AUDIT_TABLE"
            ]
          },
          "columns": [
            {
              "id": "inode-y0SWYpgiYRr7wAGlCQP85o/CONNECTOR_ID",
              "formula": "[FIVETRAN_LOG__AUDIT_TABLE/Connector Id]"
            },
            {
              "id": "inode-y0SWYpgiYRr7wAGlCQP85o/CONNECTOR_NAME",
              "formula": "[FIVETRAN_LOG__AUDIT_TABLE/Connector Name]"
            },
            {
              "id": "inode-y0SWYpgiYRr7wAGlCQP85o/TABLE_NAME",
              "formula": "[FIVETRAN_LOG__AUDIT_TABLE/Table Name]"
            },
            {
              "id": "inode-y0SWYpgiYRr7wAGlCQP85o/DESTINATION_ID",
              "formula": "[FIVETRAN_LOG__AUDIT_TABLE/Destination Id]"
            },
            {
              "id": "inode-y0SWYpgiYRr7wAGlCQP85o/DESTINATION_NAME",
              "formula": "[FIVETRAN_LOG__AUDIT_TABLE/Destination Name]"
            },
            {
              "id": "inode-y0SWYpgiYRr7wAGlCQP85o/WRITE_TO_TABLE_START",
              "formula": "[FIVETRAN_LOG__AUDIT_TABLE/Write to Table Start]"
            },
            {
              "id": "inode-y0SWYpgiYRr7wAGlCQP85o/WRITE_TO_TABLE_END",
              "formula": "[FIVETRAN_LOG__AUDIT_TABLE/Write to Table End]"
            },
            {
              "id": "inode-y0SWYpgiYRr7wAGlCQP85o/SYNC_START",
              "formula": "[FIVETRAN_LOG__AUDIT_TABLE/Sync Start]"
            },
            {
              "id": "inode-y0SWYpgiYRr7wAGlCQP85o/SYNC_END",
              "formula": "[FIVETRAN_LOG__AUDIT_TABLE/Sync End]"
            },
            {
              "id": "inode-y0SWYpgiYRr7wAGlCQP85o/SUM_ROWS_REPLACED_OR_INSERTED",
              "formula": "[FIVETRAN_LOG__AUDIT_TABLE/Sum Rows Replaced or Inserted]"
            },
            {
              "id": "inode-y0SWYpgiYRr7wAGlCQP85o/SUM_ROWS_UPDATED",
              "formula": "[FIVETRAN_LOG__AUDIT_TABLE/Sum Rows Updated]"
            },
            {
              "id": "inode-y0SWYpgiYRr7wAGlCQP85o/SUM_ROWS_DELETED",
              "formula": "[FIVETRAN_LOG__AUDIT_TABLE/Sum Rows Deleted]"
            },
            {
              "id": "inode-y0SWYpgiYRr7wAGlCQP85o/UNIQUE_TABLE_SYNC_KEY",
              "formula": "[FIVETRAN_LOG__AUDIT_TABLE/Unique Table Sync Key]"
            }
          ],
          "order": [
            "inode-y0SWYpgiYRr7wAGlCQP85o/CONNECTOR_ID",
            "inode-y0SWYpgiYRr7wAGlCQP85o/CONNECTOR_NAME",
            "inode-y0SWYpgiYRr7wAGlCQP85o/TABLE_NAME",
            "inode-y0SWYpgiYRr7wAGlCQP85o/DESTINATION_ID",
            "inode-y0SWYpgiYRr7wAGlCQP85o/DESTINATION_NAME",
            "inode-y0SWYpgiYRr7wAGlCQP85o/WRITE_TO_TABLE_START",
            "inode-y0SWYpgiYRr7wAGlCQP85o/WRITE_TO_TABLE_END",
            "inode-y0SWYpgiYRr7wAGlCQP85o/SYNC_START",
            "inode-y0SWYpgiYRr7wAGlCQP85o/SYNC_END",
            "inode-y0SWYpgiYRr7wAGlCQP85o/SUM_ROWS_REPLACED_OR_INSERTED",
            "inode-y0SWYpgiYRr7wAGlCQP85o/SUM_ROWS_UPDATED",
            "inode-y0SWYpgiYRr7wAGlCQP85o/SUM_ROWS_DELETED",
            "inode-y0SWYpgiYRr7wAGlCQP85o/UNIQUE_TABLE_SYNC_KEY"
          ],
          "columnSecurities": [
            {
              "id": "q4AqLmOMU4",
              "criteria": {
                "kind": "no-one-can-view"
              },
              "restrictedColumns": [
                "inode-1KXIXDpIKsSdi76np1gOg5/TABLE_NAME"
              ]
            }
          ]
        }
      ]
    }
  ]
}
```

## Representing column-level security

In this representation, the column security rule is represented by this object in the `columnSecurities` array for the table element:

#### Column-level security representation

```json
...
[
  {
    "id": "q4AqLmOMU4",
    "criteria": {
      "kind": "no-one-can-view"
    },
    "restrictedColumns": [
      "inode-1KXIXDpIKsSdi76np1gOg5/TABLE_NAME"
    ]
  }
]
...
```