# Zoho Analytics

> Business intelligence and reporting. Manage workspaces and tables, add, update, import and export rows, and run SQL queries.

App · Analytics · 18 actions. Web page: https://docs.lodol.com/docs/integrations/zoho-analytics

## Actions

### Add column

Add a column to a table. Costs 15 of the day's API units (the free plan has 1,000).

**Inputs**

- Workspace (`workspace_id`, text, required): The workspace. You can also paste its id or its address in Zoho Analytics.
- Table (`view_id`, text, required): The table. You can also paste its id or its address in Zoho Analytics.
- Column name (`column_name`, text, required): The new column's name; unique in the table.
- Data type (`data_type`, text, required): The kind of value the column holds. One of: `PLAIN` (Plain text), `MULTI_LINE` (Multi-line text), `EMAIL`, `NUMBER`, `POSITIVE_NUMBER` (Positive number), `DECIMAL_NUMBER` (Decimal number), `CURRENCY`, `PERCENT`, `DATE`, `BOOLEAN` (Yes/No), and 3 more. Default: `PLAIN`.
- Personal data (`is_pii`, true/false): Optional. Mark the column as holding personal data, which Zoho then protects. Default: `false`.
- Organization (`org_id`, text): Optional. The organization the workspace is in. Leave blank to use your default organization; the workspace's own is found if it is elsewhere.

**Outputs**: The column that was added.

- `column_id` (text): The new column's id.
- `column_name` (text): The column's name.
- `view_id` (text): The table it was added to.

**Example output**

```json
{
  "column_id": "1767024000003145021",
  "column_name": "Region",
  "view_id": "1767024000003145010"
}
```

### Add row

Add one row to a table.

**Inputs**

- Workspace (`workspace_id`, text, required): The workspace. You can also paste its id or its address in Zoho Analytics.
- Table (`view_id`, text, required): The table. You can also paste its id or its address in Zoho Analytics.
- Column values (`columns`, object, required): Each column's exact name and the value to store. Run 'List columns' for the names.
- Date format (`date_format`, text): Optional. How date values are written, e.g. yyyy-MM-dd or dd-MMM-yyyy HH:mm:ss. Leave blank for Zoho's default.
- Organization (`org_id`, text): Optional. The organization the workspace is in. Leave blank to use your default organization; the workspace's own is found if it is elsewhere.

**Outputs**: The row that was added.

- `added_columns` (object): Each column and the value stored in it.
- `invalid_columns` (object): Columns that were ignored because the table has no column by that name.
- `warning` (text): Names any ignored columns; empty when every column was used.

**Example output**

```json
{
  "added_columns": {
    "Region": "East",
    "Sales": "1000"
  },
  "invalid_columns": {},
  "warning": null
}
```

### Create table

Create a table with the columns you name.

**Inputs**

- Workspace (`workspace_id`, text, required): The workspace. You can also paste its id or its address in Zoho Analytics.
- Table name (`table_name`, text, required): The new table's name; unique in the workspace.
- Columns (`columns`, object, required): Each column's name and data type: PLAIN, MULTI_LINE, EMAIL, NUMBER, POSITIVE_NUMBER, DECIMAL_NUMBER, CURRENCY, PERCENT, DATE, BOOLEAN, URL, AUTO_NUMBER. For example Region: PLAIN, Sales: NUMBER.
- Description (`table_description`, text): Optional. What the table holds.
- Folder (`folder_name`, text): Optional. The folder to put it in, by name ('List folders' shows them). Blank for the default folder.
- Organization (`org_id`, text): Optional. The organization the workspace is in. Leave blank to use your default organization; the workspace's own is found if it is elsewhere.

**Outputs**: The table that was created.

- `table_name` (text): The table's name.
- `view_id` (text): The new table's id; use it as 'Table' in other steps.
- `workspace_id` (text): The workspace it was created in.

**Example output**

```json
{
  "table_name": "Orders",
  "view_id": "1767024000003145010",
  "workspace_id": "1767024000003145002"
}
```

### Create workspace

Create an empty workspace. The free plan allows five workspaces.

**Inputs**

- Workspace name (`workspace_name`, text, required): The new workspace's name; it must be unique.
- Description (`workspace_description`, text): Optional. What the workspace is for.
- Organization (`org_id`, text): Optional. The organization to create it in. Leave blank for your default organization.

**Outputs**: The workspace that was created or renamed.

- `org_id` (text): The organization it was created in.
- `renamed` (true/false): True when the workspace was renamed.
- `workspace_id` (text): The workspace's id.
- `workspace_name` (text): The workspace's name.

**Example output**

```json
{
  "org_id": "55522777",
  "workspace_id": "1767024000003145002",
  "workspace_name": "Sales"
}
```

### Delete rows

Permanently delete the rows that match a criteria, or every row, from a table.

**Inputs**

- Workspace (`workspace_id`, text, required): The workspace. You can also paste its id or its address in Zoho Analytics.
- Table (`view_id`, text, required): The table. You can also paste its id or its address in Zoho Analytics.
- Criteria (`criteria`, text): Which rows, written like a SQL WHERE clause: table and column names in double quotes, text in single quotes, dates as 'yyyy-mm-dd'. For example "Sales"."Region"='East'.
- Delete all rows (`delete_all_rows`, true/false): Optional. Delete every row in the table. Needed when no criteria is given. Default: `false`.
- Organization (`org_id`, text): Optional. The organization the workspace is in. Leave blank to use your default organization; the workspace's own is found if it is elsewhere.

**Outputs**: What the delete removed.

- `deleted_rows` (number): How many rows were deleted.

**Example output**

```json
{
  "deleted_rows": 1
}
```

### Delete view

Permanently delete a table, report or dashboard. Deleting a table deletes its data.

**Inputs**

- Workspace (`workspace_id`, text, required): The workspace. You can also paste its id or its address in Zoho Analytics.
- View (`view_id`, text, required): The table, report or dashboard. You can also paste its id or its address in Zoho Analytics.
- Delete dependent views (`delete_dependent_views`, true/false): Optional. Also delete the reports built on this table; without it, a table with reports is not deleted. Default: `false`.
- Organization (`org_id`, text): Optional. The organization the workspace is in. Leave blank to use your default organization; the workspace's own is found if it is elsewhere.

**Outputs**: The view that was deleted.

- `deleted` (true/false): Always true.
- `view_id` (text): The deleted view's id.

**Example output**

```json
{
  "deleted": true,
  "view_id": "1767024000003145010"
}
```

### Delete workspace

Permanently delete a workspace with all its tables, reports and dashboards.

**Inputs**

- Workspace (`workspace_id`, text, required): The workspace. You can also paste its id or its address in Zoho Analytics.
- Organization (`org_id`, text): Optional. The organization the workspace is in. Leave blank to use your default organization; the workspace's own is found if it is elsewhere.

**Outputs**: The workspace that was deleted.

- `deleted` (true/false): Always true.
- `workspace_id` (text): The deleted workspace's id.

**Example output**

```json
{
  "deleted": true,
  "workspace_id": "1767024000003145002"
}
```

### Export data

Export a table's or report's rows as JSON or CSV. Not for dashboards, query tables, live-connect workspaces or tables over a million rows; use 'Run SQL query' for those.

**Inputs**

- Workspace (`workspace_id`, text, required): The workspace. You can also paste its id or its address in Zoho Analytics.
- View (`view_id`, text, required): The table, report or dashboard. You can also paste its id or its address in Zoho Analytics.
- Format (`response_format`, text): JSON rows (default) or CSV text. One of: `json`, `csv`. Default: `json`.
- Criteria (`criteria`, text): Which rows, written like a SQL WHERE clause: table and column names in double quotes, text in single quotes, dates as 'yyyy-mm-dd'. For example "Sales"."Region"='East'.
- Columns (`selected_columns`, list): Optional. Only these columns, by exact name.
- Hidden columns (`show_hidden_columns`, true/false): Optional. Include hidden columns. Default: `false`.
- Include header (`include_header`, true/false): Optional, CSV only. Start with a row of column names. Default: `true`.
- Organization (`org_id`, text): Optional. The organization the workspace is in. Leave blank to use your default organization; the workspace's own is found if it is elsewhere.

**Outputs**

- `csv` (text): For CSV: the exported text.
- `format` (text): json or csv.
- `row_count` (number): How many rows were exported.
- `rows` (list): For JSON: one object per row, keyed by column name.

**Example output**

```json
{
  "format": "json",
  "row_count": 1,
  "rows": [
    {
      "Region": "East",
      "Sales": "1000"
    }
  ]
}
```

### Get view

Get a table, report or dashboard's details.

**Inputs**

- View ID (`view_id`, text, required): The view's id, from 'List views', or its address in Zoho Analytics.
- Include columns (`include_columns`, true/false): Optional. Also return its columns and the views it uses. Default: `false`.

**Outputs**: A table, report or dashboard's details. Column details are included when asked for.

- `orgId` (text): The organization it is in.
- `viewDesc` (text): The view's description.
- `viewId` (text): The view's id.
- `viewName` (text): The view's name.
- `viewType` (text): What it is, e.g. Table, AnalysisView or Dashboard.
- `workspaceId` (text): The workspace it is in.

**Example output**

```json
{
  "orgId": "55522777",
  "viewDesc": "",
  "viewId": "1767024000003145010",
  "viewName": "Orders",
  "viewType": "Table",
  "workspaceId": "1767024000003145002"
}
```

### Import rows

Import many rows into a table in one call: append them, replace every existing row, or update matching rows and add the rest.

**Inputs**

- Workspace (`workspace_id`, text, required): The workspace. You can also paste its id or its address in Zoho Analytics.
- Table (`view_id`, text, required): The table. You can also paste its id or its address in Zoho Analytics.
- Rows (`rows`, list, required): The rows: a list of objects mapping column names to values, e.g. [{"Region": "East", "Sales": "1000"}]. Up to 10,000 rows.
- Import type (`import_type`, text): Append adds the rows. Replace all rows deletes every existing row first. Update or add needs Matching columns. One of: `append`, `truncateadd` (Replace all rows (deletes existing rows)), `updateadd` (Update matching rows, add the rest). Default: `append`.
- On error (`on_error`, text): Optional. What to do with a row that does not fit. One of: `abort` (Stop the import), `skiprow` (Skip the row), `setcolumnempty` (Leave the bad value empty).
- Matching columns (`matching_columns`, list): For 'Update matching rows' only: the columns that identify an existing row.
- Date format (`date_format`, text): Optional. How date values are written, e.g. yyyy-MM-dd or dd-MMM-yyyy HH:mm:ss. Leave blank for Zoho's default.
- Organization (`org_id`, text): Optional. The organization the workspace is in. Leave blank to use your default organization; the workspace's own is found if it is elsewhere.

**Outputs**: What the import did.

- `column_details` (object): Each imported column and its data type.
- `import_errors` (text): What went wrong with any rows that were not imported.
- `import_summary` (object): Zoho's summary of the import.

**Example output**

```json
{
  "column_details": {
    "Region": "Plain Text",
    "Sales": "Number"
  },
  "import_errors": "",
  "import_summary": {
    "importOperation": "updated",
    "importType": "APPEND",
    "selectedColumnCount": 2,
    "successRowCount": 1,
    "totalColumnCount": 2,
    "totalRowCount": 1,
    "warnings": 0
  }
}
```

### List columns

List a table's columns with their exact names and data types, as rows and criteria must use them.

**Inputs**

- Workspace (`workspace_id`, text, required): The workspace. You can also paste its id or its address in Zoho Analytics.
- Table (`view_id`, text, required): The table. You can also paste its id or its address in Zoho Analytics.
- Organization (`org_id`, text): Optional. The organization the workspace is in. Leave blank to use your default organization; the workspace's own is found if it is elsewhere.

**Outputs**

- `count` (number): How many columns were returned.
- `items` (list): The columns.

**Example output**

```json
{
  "count": 1,
  "items": [
    {
      "columnDesc": "",
      "columnId": "1767024000003145021",
      "columnIndex": 1,
      "columnMaxSize": 100,
      "columnName": "Region",
      "dataType": "PLAIN",
      "dataTypeId": 1,
      "dataTypeName": "Plain Text",
      "defaultValue": "",
      "formulaDisplayName": "",
      "isHidden": false,
      "isNullable": true,
      "pkColumnName": "",
      "pkTableName": "",
      "sortedIndex": 0,
      "sortedOrder": 0
    }
  ]
}
```

### List folders

List the folders in a workspace.

**Inputs**

- Workspace (`workspace_id`, text, required): The workspace. You can also paste its id or its address in Zoho Analytics.
- Organization (`org_id`, text): Optional. The organization the workspace is in. Leave blank to use your default organization; the workspace's own is found if it is elsewhere.

**Outputs**

- `count` (number): How many folders were returned.
- `items` (list): The folders.

**Example output**

```json
{
  "count": 1,
  "items": [
    {
      "folderDesc": "",
      "folderId": "1767024000003145005",
      "folderIndex": 1,
      "folderName": "Tables",
      "isDefault": true,
      "parentFolderId": "-1"
    }
  ]
}
```

### List organizations

List the Zoho Analytics organizations you belong to.

**Inputs**: None.

**Outputs**

- `count` (number): How many organizations were returned.
- `items` (list): The organizations.

**Example output**

```json
{
  "count": 1,
  "items": [
    {
      "createdBy": "owner@example.com",
      "createdByZuId": "55522001",
      "isDefault": true,
      "numberOfworkspaces": 2,
      "orgDesc": "",
      "orgId": "55522777",
      "orgName": "Acme",
      "planName": "Free",
      "role": "Account Admin"
    }
  ]
}
```

### List views

List the tables, reports and dashboards in a workspace, optionally filtered by type or name.

**Inputs**

- Workspace (`workspace_id`, text, required): The workspace. You can also paste its id or its address in Zoho Analytics.
- Types (`view_types`, text): Optional. Only these kinds of view; all by default. One or more of: `0` (Table), `1` (Tabular view), `2` (Chart), `3` (Pivot), `4` (Summary view), `6` (Query table), `7` (Dashboard).
- Keyword (`keyword`, text): Optional. Only views whose name contains this.
- Sort by (`sort_by`, text): Optional. What to sort by. One of: `0` (Name), `1` (Created time), `2` (Last modified time).
- Order (`sort_order`, text): Optional. Sort direction. One of: `0` (Ascending), `1` (Descending).
- Limit (`limit`, number): Optional. The most views to return. From 1 to 10000.
- Start index (`start_index`, number): Optional. Where to start; for the next page, increase it by the limit. At least 0.
- Organization (`org_id`, text): Optional. The organization the workspace is in. Leave blank to use your default organization; the workspace's own is found if it is elsewhere.

**Outputs**

- `count` (number): How many views were returned.
- `items` (list): The views.

**Example output**

```json
{
  "count": 1,
  "items": [
    {
      "createdBy": "owner@example.com",
      "createdTime": "1767225600000",
      "folderId": "1767024000003145005",
      "isFavorite": false,
      "lastModifiedBy": "owner@example.com",
      "lastModifiedTime": "1767225600000",
      "parentViewId": "",
      "sharedBy": "",
      "viewDesc": "",
      "viewId": "1767024000003145010",
      "viewName": "Orders",
      "viewType": "Table"
    }
  ]
}
```

### List workspaces

List the workspaces you own or that were shared with you, in every organization.

**Inputs**: None.

**Outputs**

- `count` (number): How many workspaces were returned.
- `items` (list): The workspaces.
- `owned_count` (number): How many of them the user owns.
- `shared_count` (number): How many were shared with the user.

**Example output**

```json
{
  "count": 1,
  "items": [
    {
      "createdBy": "owner@example.com",
      "createdTime": "1767225600000",
      "isDefault": false,
      "orgId": "55522777",
      "owned": true,
      "workspaceDesc": "",
      "workspaceId": "1767024000003145002",
      "workspaceName": "Sales"
    }
  ],
  "owned_count": 1,
  "shared_count": 0
}
```

### Rename workspace

Rename a workspace and optionally change its description.

**Inputs**

- Workspace (`workspace_id`, text, required): The workspace. You can also paste its id or its address in Zoho Analytics.
- New name (`workspace_name`, text, required): The workspace's name. Required even when only the description changes; give the current name to keep it.
- Description (`workspace_description`, text): Optional. What the workspace is for.
- Organization (`org_id`, text): Optional. The organization the workspace is in. Leave blank to use your default organization; the workspace's own is found if it is elsewhere.

**Outputs**: The workspace that was created or renamed.

- `org_id` (text): The organization it was created in.
- `renamed` (true/false): True when the workspace was renamed.
- `workspace_id` (text): The workspace's id.
- `workspace_name` (text): The workspace's name.

**Example output**

```json
{
  "renamed": true,
  "workspace_id": "1767024000003145002",
  "workspace_name": "Sales 2026"
}
```

### Run SQL query

Run a SQL SELECT over a workspace's tables and return the rows. Waits up to about two minutes for Zoho to finish.

**Inputs**

- Workspace (`workspace_id`, text, required): The workspace. You can also paste its id or its address in Zoho Analytics.
- SQL query (`sql_query`, text, required): A SELECT statement. Put table and column names in double quotes, e.g. SELECT "Region", SUM("Sales") FROM "Orders" GROUP BY "Region".
- Format (`response_format`, text): JSON rows (default) or CSV text. One of: `json`, `csv`. Default: `json`.
- Organization (`org_id`, text): Optional. The organization the workspace is in. Leave blank to use your default organization; the workspace's own is found if it is elsewhere.

**Outputs**

- `csv` (text): For CSV: the exported text.
- `format` (text): json or csv.
- `job_id` (text): The id of the export job that ran the query.
- `row_count` (number): How many rows were exported.
- `rows` (list): For JSON: one object per row, keyed by column name.

**Example output**

```json
{
  "format": "json",
  "job_id": "1767024000003153003",
  "row_count": 1,
  "rows": [
    {
      "Region": "East",
      "Sales": "1000"
    }
  ]
}
```

### Update rows

Update the rows that match a criteria, or every row, in a table.

**Inputs**

- Workspace (`workspace_id`, text, required): The workspace. You can also paste its id or its address in Zoho Analytics.
- Table (`view_id`, text, required): The table. You can also paste its id or its address in Zoho Analytics.
- New values (`columns`, object, required): Each column's exact name and its new value. Run 'List columns' for the names.
- Criteria (`criteria`, text): Which rows, written like a SQL WHERE clause: table and column names in double quotes, text in single quotes, dates as 'yyyy-mm-dd'. For example "Sales"."Region"='East'.
- Update all rows (`update_all_rows`, true/false): Optional. Update every row in the table. Needed when no criteria is given. Default: `false`.
- Add if none match (`add_if_not_exist`, true/false): Optional. Add a row when no row matches the criteria. Default: `false`.
- Date format (`date_format`, text): Optional. How date values are written, e.g. yyyy-MM-dd or dd-MMM-yyyy HH:mm:ss. Leave blank for Zoho's default.
- Organization (`org_id`, text): Optional. The organization the workspace is in. Leave blank to use your default organization; the workspace's own is found if it is elsewhere.

**Outputs**: What the update changed.

- `invalid_columns` (object): Columns that were ignored because the table has no column by that name.
- `updated_columns` (object): Each column and the value written to it.
- `updated_rows` (number): How many rows were updated.
- `warning` (text): Names any ignored columns; empty when every column was used.

**Example output**

```json
{
  "invalid_columns": {},
  "updated_columns": {
    "Sales": "1200"
  },
  "updated_rows": 1,
  "warning": null
}
```
