> ## Documentation Index
> Fetch the complete documentation index at: https://openops-f559c8bf.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Tables

> Saving data into and getting data from OpenOps Tables

OpenOps includes tables, a data storage mechanism based on [Baserow](https://baserow.io/user-docs/intro-to-tables). They are a hybrid of a spreadsheet and a database: think Airtable. Here are some of the things that tables help you do:

* **Sort and filter** your data: for example, only show opportunities that are not completed or dismissed.
* **Group** your data: for example, show opportunities by owner.
* **Import and export** data from/to CSV, JSON, or XML.
* **Link to other tables**, much like relational databases.

OpenOps tables are fully integrated with OpenOps workflow capabilities: there are [actions](https://openops-f559c8bf.mintlify.site/workflow-management/actions.md) that let you create and update records in tables, as well as read data from them.

Tables help you perform multiple tasks, such as:

* Map **cloud resources to owners** based on tags and business units. This is an essential stage for workflows that include [human-in-the-loop](https://openops-f559c8bf.mintlify.site/workflow-management/human-in-the-loop.md) steps. For every resource that provides cost-saving opportunities requiring human intervention, the workflow needs a way to determine who to send an approval request to.
* Log **opportunities and anomalies** in a central location, with options to approve, dismiss, mark as false positive, or snooze.
* Compile a list of unused or idle **resources to delete**.
* Generate **spend reports** broken down by business unit, owner, or cloud service.

## Preconfigured tables

OpenOps comes with multiple [workflow templates](https://openops-f559c8bf.mintlify.site/workflow-management/workflow-templates.md), and many of them use tables to perform one or more of the tasks outlined above. All tables used in the templates come preconfigured in your workflow installation:

![Preconfigured tables](https://mintcdn.com/openops-f559c8bf/gQJpq14WxmjJU9s5/images/tables-preconfigured.png?fit=max\&auto=format\&n=gQJpq14WxmjJU9s5\&q=85\&s=f595a1e5e46be25fb2c99fabd6a6f94b)

This means that when you decide to create a workflow based on a template, you don't need to create the tables that your workflow uses: they're already available. If you’re using workflows from templates, make sure not to modify the structure of preconfigured tables to avoid breaking the workflows.

Let's take a look at two tables that come preconfigured and are used in many workflow templates: **Opportunities** and **Tag-owner mapping**.

### Opportunities

The preconfigured **Opportunities** table is used in multiple workflow templates to track realized and unrealized savings and to provide visibility into why savings have not yet been achieved.

By default, this table has 20 fields (columns): **ID**, **Status**, **Owner**, **Estimated savings USD per month**, **Snoozed until**, **Workflow**, **Resource ID**, **Follow-up task**, **Account**, **Region**, **Service**, **Opportunity source**, **External opportunity ID**, **Opportunity type**, **Resolution notes**, **Opportunity details**, **Complexity**, **Risk**, **Creation time**, and **Last modified time**.

Here's a sample of the **Opportunities** table in an active OpenOps installation:

![Sample Opportunities table](https://mintcdn.com/openops-f559c8bf/gQJpq14WxmjJU9s5/images/tables-opportunity.png?fit=max\&auto=format\&n=gQJpq14WxmjJU9s5\&q=85\&s=86a08a79f30a3e3834d3eeec9c20dec1)

### Tag-owner mapping

The preconfigured **Tag-owner mapping** table is used in workflow templates to retrieve emails of resource owners based on values of resource tags whose labels are specified in the workflow.

This table has three fields: **Owner tag value**, **Owner email**, and **BU**. The latter connects it to another preconfigured table, **Business units**, which stores more details about each business unit.

### Example of usage in a workflow template

To better understand how the two tables described above are used in real-life workflows, here's what the **Idle RDS Instances in Staging, Terraform Remediation** workflow template does with them:

* For each AWS Compute Optimizer recommendation for idle RDS, it finds the value of the `unit` tag and maps that tag to an email using the **Tag-owner mapping** table.
* It logs opportunity details to the **Opportunities** table with the following fields:
  * **Status** is set to **Created**, as this is a new opportunity.
  * **Estimated savings USD per month** is set to the estimate provided by AWS Compute Optimizer.
* Once the owner receives a Slack message suggesting deletion of the resource, the **Status** field in the **Opportunities** table is updated with one of three values:
  * **Under review** if the owner approved deletion and the workflow has created a GitHub PR.
  * **Dismissed** if the owner has chosen to dismiss the opportunity.
  * **Snoozed** if the owner has chosen to consider the opportunity later. The number of days to delay is reflected in the **Snoozed until** field.

## Creating new tables

In addition to preconfigured tables, you can create your own. This is especially useful when you're developing original workflows that are not based on OpenOps templates and you want to set up a visual way to save data generated by the workflows.

To create a new table from scratch:

1. Go to the **Tables** tab. In the tree view on the left, click **+ Create table** under the list of currently available tables in the **OpenOps Table** dataset:

   ![Creating a table](https://mintcdn.com/openops-f559c8bf/gQJpq14WxmjJU9s5/images/tables-tree-create.png?fit=max\&auto=format\&n=gQJpq14WxmjJU9s5\&q=85\&s=845bc7f882a8e4df498fb87b161ad397)
2. In the **Create new table** popup, keep **Start with a new table** selected and click **Add table**:

   ![Create new table popup](https://mintcdn.com/openops-f559c8bf/gQJpq14WxmjJU9s5/images/tables-create-new-table.png?fit=max\&auto=format\&n=gQJpq14WxmjJU9s5\&q=85\&s=a30a0f08255d0c092901e0d945e23586)

A new table is created with three default fields:

![Default table](https://mintcdn.com/openops-f559c8bf/gQJpq14WxmjJU9s5/images/tables-default.png?fit=max\&auto=format\&n=gQJpq14WxmjJU9s5\&q=85\&s=80b427c7dad2d9c6c9f91e0bfb2b01bf)

Feel free to remove the default fields and add new ones depending on your use case. When you click **+** in the table header to create a new field, you can choose from multiple field types:

![Table field types](https://mintcdn.com/openops-f559c8bf/gQJpq14WxmjJU9s5/images/tables-add-fields.png?fit=max\&auto=format\&n=gQJpq14WxmjJU9s5\&q=85\&s=2a02853439452660f3cf1c963fe823c2)

In the tree view on the left, if you click the options icon alongside your table's name, you can choose to rename, duplicate, export, or delete your table:

![Table options](https://mintcdn.com/openops-f559c8bf/gQJpq14WxmjJU9s5/images/tables-table-options.png?fit=max\&auto=format\&n=gQJpq14WxmjJU9s5\&q=85\&s=5f9500bb829318adc6817b13ba575732)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.