# Smartsheet

{% hint style="info" %}
The following documentation is for **Smartsheet v2.0.0** *(BDK)*.
{% endhint %}

## Overview

Smartsheet is a dynamic work management platform that combines spreadsheet functionality with project management features. This integration enables automated sheet updates, project tracking, resource management, and collaborative workflow automation. Improve project organization and team productivity.

## Prerequisites

### 1. Required Books

The following Book(s) need to be added to your agent so it can learn and understand the automation procedures defined within them:

* **Smartsheet**

#### How to Add the Book(s)

1. Go to **Books** → **All Books**.
2. Search for the name of the book and click on it.
3. Click on <kbd>**Install**</kbd> or <kbd>**Add Connection**</kbd> to add the book to your agent.
4. If adding a connection, you'll be prompted for [**connectivity**](#connectivity) details.

## Connectivity

This section outlines the available methods for connecting to the Book, along with the required configuration details for each.

### Connect using token

Authenticate with the provided token.

| Label | Description                                  | Type        |
| ----- | -------------------------------------------- | ----------- |
| token | Smartsheet API token used for authentication | `sensitive` |

## Procedures

### to add some content to a sheet

Append the contents of a table into an existing sheet.

This procedure adds new rows from a table to an existing sheet, matching the table columns to the sheet's existing column structure.

**Input Concepts**

| Concept                      | Description                      | Type               | Required | Default Value |
| ---------------------------- | -------------------------------- | ------------------ | -------- | ------------- |
| [`sheet`](#smartsheet-sheet) | The sheet to add the content to. | `smartsheet sheet` | Yes      | (no default)  |
| `content`                    | The table object to append.      | `table`            | Yes      | (no default)  |

**Output Concepts**

| Concept                       | Description                           | Type               |
| ----------------------------- | ------------------------------------- | ------------------ |
| [`answer`](#smartsheet-sheet) | the sheet the content was appended to | `smartsheet sheet` |

**Examples**

Append the contents of a table in a sheet

```generic
get a sheet whose name is "Invoices"
>>>
create a table where
the column names are "Product Id", "Price"
insert a row in the table where
    the Product Id is "00003"
    the Price is 313
use the table as the content
>>>
add the content to the sheet
```

### to get some (sheet's columns)

Get a sheet's columns.

This procedure retrieves all columns from a sheet, including their names and types.

**Input Concepts**

| Concept                      | Description                  | Type               | Required | Default Value |
| ---------------------------- | ---------------------------- | ------------------ | -------- | ------------- |
| [`sheet`](#smartsheet-sheet) | The sheet to get columns for | `smartsheet sheet` | Yes      | (no default)  |

**Output Concepts**

| Concept                                 | Description       | Type                |
| --------------------------------------- | ----------------- | ------------------- |
| [`sheet's columns`](#smartsheet-column) | a list of columns | `smartsheet column` |

**Examples**

Get the sheet's columns

```generic
get a sheet whose name is "Invoices"
get the sheet's columns
```

### to get some (sheet's rows)

![FILTER - CAPABLE](https://img.shields.io/static/v1?label=FILTER\&message=CAPABLE\&color=blue)

Get a sheet's rows.

This procedure retrieves all rows from a sheet, or can filter rows based on specific column values.

**Input Concepts**

| Concept                      | Description               | Type               | Required | Default Value |
| ---------------------------- | ------------------------- | ------------------ | -------- | ------------- |
| [`sheet`](#smartsheet-sheet) | The sheet to get rows for | `smartsheet sheet` | Yes      | (no default)  |

**Output Concepts**

| Concept                           | Description    | Type             |
| --------------------------------- | -------------- | ---------------- |
| [`sheet's rows`](#smartsheet-row) | a list of rows | `smartsheet row` |

**Examples**

Get the sheet's rows

```generic
get a sheet whose name is "Invoices"
get the sheet's rows
```

### to get some (sheets)

![FILTER - CAPABLE](https://img.shields.io/static/v1?label=FILTER\&message=CAPABLE\&color=blue)

Gets all sheets.

This procedure can get a list of all sheets, as well as getting a single sheet by filtering by its name.

**Output Concepts**

| Concept                       | Description      | Type               |
| ----------------------------- | ---------------- | ------------------ |
| [`sheets`](#smartsheet-sheet) | A list of sheets | `smartsheet sheet` |

**Examples**

Get all sheets

```generic
get some sheets
```

Get a sheet by name

```generic
get the sheet whose name is "Products"
```

### to get some (workspaces)

![FILTER - CAPABLE](https://img.shields.io/static/v1?label=FILTER\&message=CAPABLE\&color=blue)

Gets all workspaces.

This procedure can get a list of all workspaces, as well as getting a single workspace by filtering by its name.

**Output Concepts**

| Concept                               | Description          | Type                   |
| ------------------------------------- | -------------------- | ---------------------- |
| [`workspaces`](#smartsheet-workspace) | A list of workspaces | `smartsheet workspace` |

**Examples**

Get all workspaces

```generic
get some workspaces
```

Get a workspace by name

```generic
get a workspace whose name is "Workspace Name"
```

### to insert a (new column) in a sheet

Inserts a column in a sheet.

This procedure adds a new column to a sheet at a specific position, allowing you to specify the column name and type.

**Input Concepts**

| Concept                      | Description                               | Type                                                                                                                                      | Required | Default Value |
| ---------------------------- | ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------------- |
| [`sheet`](#smartsheet-sheet) | The sheet to add the column to            | `smartsheet sheet`                                                                                                                        | Yes      | (no default)  |
| `name`                       | Name of column to add                     | `text`                                                                                                                                    | Yes      | (no default)  |
| `column type`                | Type of column to add                     | `enum[abstract_datetime, checkbox, contact_list, date, datetime, multi_contact_list, multi_picklist, picklist, predecessor, text_number]` | Yes      | (no default)  |
| `index`                      | Index of column to add (First index is 1) | `number`                                                                                                                                  | Yes      | (no default)  |

**Output Concepts**

| Concept                            | Description        | Type                |
| ---------------------------------- | ------------------ | ------------------- |
| [`new column`](#smartsheet-column) | the created column | `smartsheet column` |

**Examples**

Insert a new column at index

```generic
get a sheet whose name is "Products"
>>>
insert a new column in the sheet where
    the name is "Product Type"
    the column type is "TEXT_NUMBER"
    the index is 2
```

### to insert a (new row) in a sheet

Append a row in a sheet.

This procedure adds a new row to a sheet with the specified values, and can optionally indent the row under an existing parent row.

**Input Concepts**

| Concept                         | Description                                              | Type                            | Required | Default Value |
| ------------------------------- | -------------------------------------------------------- | ------------------------------- | -------- | ------------- |
| [`sheet`](#smartsheet-sheet)    | The sheet to add the row to                              | `smartsheet sheet`              | Yes      | (no default)  |
| `values`                        | List of values to insert                                 | `boolean` or `number` or `text` | Yes      | (no default)  |
| [`parent row`](#smartsheet-row) | An existing row under which the new row will be indented | `smartsheet row`                | No       | (no default)  |

**Output Concepts**

| Concept                      | Description     | Type             |
| ---------------------------- | --------------- | ---------------- |
| [`new row`](#smartsheet-row) | the created row | `smartsheet row` |

**Examples**

Append a new row to a sheet

```generic
get a sheet whose name is "Documents"
insert a new row in the sheet where
    the values are 384230, "Invoice", "Completed"
```

### to write the content in a workspace

Set the contents of a table to a new sheet.

This procedure creates a new sheet within a workspace and populates it with the contents of a table, including all columns and rows.

**Input Concepts**

| Concept                              | Description                           | Type                   | Required | Default Value |
| ------------------------------------ | ------------------------------------- | ---------------------- | -------- | ------------- |
| [`workspace`](#smartsheet-workspace) | Workspace to create the sheet in.     | `smartsheet workspace` | Yes      | (no default)  |
| `sheet name`                         | The name of the new sheet.            | `text`                 | Yes      | (no default)  |
| `content`                            | The table object to set in the sheet. | `table`                | Yes      | (no default)  |

**Output Concepts**

| Concept                       | Description       | Type               |
| ----------------------------- | ----------------- | ------------------ |
| [`answer`](#smartsheet-sheet) | the created sheet | `smartsheet sheet` |

**Examples**

Set the contents of a table into a new sheet

```generic
get a workspace whose name is "Workspace Name"
>>>
create a table where
the column names are "Product Id", "Price"
insert a row in the table where
    the Product Id is "00003"
    the Price is 313
use the table as the content
>>>
write the content in the workspace
      the sheet name is "Product Sheet"
```

## Concepts

### Smartsheet sheet

A Sheet in Smartsheet

| Field Name | Description           | Type     |
| ---------- | --------------------- | -------- |
| `id`       | The id of the sheet   | `number` |
| `name`     | The name of the sheet | `text`   |

### Smartsheet column

A column from a sheet.

| Field Name    | Description             | Type                                                                                                                                      |
| ------------- | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `id`          | The id of the column    | `optional[number]`                                                                                                                        |
| `title`       | The name of the column  | `text`                                                                                                                                    |
| `column_type` | The type of the column  | `enum[abstract_datetime, checkbox, contact_list, date, datetime, multi_contact_list, multi_picklist, picklist, predecessor, text_number]` |
| `index`       | The index of the column | `number`                                                                                                                                  |

### Smartsheet row

A row from a sheet.

| Field Name                  | Description                                              | Type                      |
| --------------------------- | -------------------------------------------------------- | ------------------------- |
| `id`                        | The id of the row                                        | `optional[number]`        |
| `row_number`                | The number of the row                                    | `optional[number]`        |
| [`cells`](#smartsheet-cell) | list of the cells from the row                           | `list of smartsheet cell` |
| `content`                   | a dictionary of column name to cell value in that column | `optional[json]`          |
| `parent_row_id`             | the id of the parent row if this row is indented         | `optional[number]`        |

### Smartsheet cell

A cell from a sheet.

| Field Name     | Description                          | Type               |
| -------------- | ------------------------------------ | ------------------ |
| `column_id`    | The id of the column for the cell    | `number`           |
| `column_title` | The title of the column for the cell | `text`             |
| `row_id`       | The id of the row for the cell       | `optional[number]` |
| `value`        | The value of the cell                | `any`              |

### Smartsheet workspace

A Workspace in Smartsheet

| Field Name | Description               | Type     |
| ---------- | ------------------------- | -------- |
| `id`       | The id of the workspace   | `number` |
| `name`     | The name of the workspace | `text`   |
