> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omni.co/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.omni.co/feedback

```json
{
  "path": "/share/deliveries/google-sheets",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Delivering Omni content to Google Sheets

> With Google Sheets deliveries, you can automatically schedule sending individual tiles to Google Sheets.

export const contentCopy_0 = "Select the tile you want to deliver."

export const destination_0 = "Google Sheets"

## Limitations

* Only single tile deliveries are supported
* Cannot be used with an [embedded Omni instance](/embed)

## Creating a Google Sheets delivery

<Note>
  To use Google Sheets as a destination, you'll need an existing Google Sheet workbook that you have write access to. **This sheet should be blank** as Omni includes column headers in the delivery.
</Note>

### 1. Configure the delivery settings

1. Navigate to a **published** dashboard.
2. Click **File > Deliveries & Alerts**. The delivery options will display on the left side of the page.
3. Fill in the following:

   * **Delivery** - Select **Schedule** or **Alert**.
   * **Send** - {contentCopy_0}
   * **Destination** - Select **{destination_0}**.
   * **Name** - Enter a name for the delivery.

**If creating an alert**, use the **Alert** tab to define the conditions that must be met to trigger the delivery. For example, you have a chart that tracks the **Total sales** for your ecommerce company. Using an alert, you can trigger a delivery when the total of your sales has changed.

### 2. Configure the delivery schedule

In this step, you'll define the cadence for the delivery:

* For **schedules**, this determines when Omni will deliver the specified content to the destination
* For **alerts**, this tells Omni when to check if the current query results meet the conditions required to send the delivery

Schedules can be defined using the visual options or with cron:

<AccordionGroup>
  <Accordion title="Visual schedule builder" icon="calendar" description="Easy point-and-click schedule builder">
    Use the UI options (**Daily**, **Weekly**, etc.) to select a time period.

    By default, schedules are set to send in the local timezone of the delivery creator's computer. Use the **Times are in** drop down to change the timezone.
  </Accordion>

  <Accordion title="Custom cron schedule (Advanced)" icon="asterisk" description="Code-based granular timing control">
    A cron expression is a string that describes the individual details of a schedule:

    | Order | Unit         | Allowed values  | Allowed special characters |
    | ----- | ------------ | --------------- | -------------------------- |
    | 1     | minute       | 0-59            | \* , - /                   |
    | 2     | hour         | 0-23            | \* , - /                   |
    | 3     | day of month | 1-31            | \* , - / L W ?             |
    | 4     | month        | 1-12 or JAN-DEC | \* , - /                   |
    | 5     | day of week  | 1-7 or SUN-SAT  | \* , - / L W ?             |
    | 6     | year         | any             | \* , - /                   |

    Using cron, you can create schedules like the following:

    ```markdown title="At 9:00 AM every day" theme={null}
    0 9 ? * * *
    ```

    ```markdown title="At 6:30AM on the last day of the month" theme={null}
    30 6 L * ? *
    ```

    ```markdown title="At 8:45 AM every day, Monday through Friday" theme={null}
    45 8 ? * MON-FRI *
    ```

    Omni uses Amazon Web Services' (AWS) syntax for cron expressions. Refer to the [AWS documentation](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-scheduled-rule-pattern.html) for more information. By default, the most frequent you can configure a schedule is hourly.

    <Tip>
      If your organization has [AI enabled](/ai/settings/features), you can use the AI cron generator to create cron expressions from natural language. Click the sparkle icon next to the cron input field and describe your desired schedule, such as "every weekday at 9am" or "first Monday of each month at noon."
    </Tip>
  </Accordion>
</AccordionGroup>

<Tip>
  Schedule send timezone may be different than query run timezone. For example, if your **Database timezone** is `UTC` with no other timezone conversion settings and you set your schedule to send at `12:00 PM PST`, the query will execute at `8:00 PM UTC`.

  Refer to your [connection timezone settings](/connect-data/timezones) for more information.
</Tip>

### 3. Select format and filter options

The **Chart** tab allows you to specify format and filter options for the delivery:

* **Apply data formatting** - Preserves number, date, currency, and other formatting in the delivery
* **Exclude hidden columns**
* **Send all possible results**, which will ignore any limits applied to the underlying query
* **Set filter or control values for the delivery**. Some formats will have additional customization options. PDF formats, for example, will allow you to specify the orientation and page size for the PDF.

<Tip>
  You can use filters to customize content for different recipients! For example, set a filter to `A` in a scheduled delivery to recipient A, and in another scheduled delivery to recipient B, set a filter to `B`.
</Tip>

### 4. Connect your Google Drive account

<Note>
  This step is only required the first time a Google Sheets delivery is created in your Omni instance.
</Note>

1. Click the **Google Sheets** tab.
2. Connect your Google Drive account. **Grant Omni all requested permissions or deliveries may not succeed.**

   When you connect your Google account, you grant Omni permission to deliver data to Sheets on your behalf. You will not see Omni listed as a collaborator in the Sheets share modal. To review or revoke this access, refer to [your Google account connections](https://myaccount.google.com/connections).
3. Use the link in the **Spreadsheet** section to browse for and select the Google Sheet workbook to send the delivery to.
4. In Omni, select a **Write mode** for the delivery:
   * **Overwrite the data on a sheet** - Data in the sheet is overwritten on each successful delivery, including column headers
   * **Create a new sheet for each delivery** - Creates a new sheet in the workbook for each successful delivery
   * **Append the data on a sheet** - On every successful delivery, new results are added to the specified sheet starting with the first empty row.

     <Note>
       Write mode options have a few considerations if you're working with pivoted data:

       * **If creating a new schedule** and Omni detects pivoted data in the query, the **Append** option will be unavailable
       * **If editing a schedule** and Omni detects that the query has changed to include pivoted data, it will change the write mode to **Overwrite**

       Refer to the [Delivering pivoted data section](#delivering-pivoted-data) for more information.
     </Note>
5. Lastly, define the sheet name. The field that displays depends on the **Write mode** you selected:
   * **Overwrite or append** - Enter the name of the sheet Omni should write data to in the **Sheet name** field. If Omni can't find a sheet with this exact name, it will create a sheet.
   * **New sheet for each delivery** - Enter a prefix for the sheet name in the **New sheet name prefix** field. A Unix timestamp of the delivery time will be appended to create the full sheet name: `{prefix}_{unixtimestamp}`

### 5. Test the delivery

If you want to test the delivery before saving, click the **Test Now** button in the bottom left corner of the page. This will send the dashboard/chart to the destination using the current settings. For example, using **Test Now** would send the delivery to all **Recipients**.

<Note>
  The **Test Now** button will be unavailable for alerts if the **Condition type** is `Results have changed` or `Results have stayed the same`. A workaround is to use the **Send Now** option to manually trigger the delivery, which is available once the delivery has been saved.

  Save the alert and then click the <Icon icon="ellipsis-vertical" type="solid" /> icon to display the **Send Now** option. This will initiate a check on the alert condition - if the condition isn't met, the delivery will show as successful but not send anything.
</Note>

### 6. Save the delivery

When finished, click **Save** to create the delivery.

## Delivering pivoted data

If your query contains pivoted data, there are a few things to consider when configuring a delivery to Google Sheets.

In a typical table, column order doesn't usually have to be strictly maintained to retain the accuracy of the data. In pivoted data, however, the data's column structure is directly tied to the position of its pivot dimensions.

To ensure the data that Omni delivers is accurate, only the **Overwrite** and **Create new sheet** options are supported for delivering pivoted data:

* **If creating a new schedule** and Omni detects pivoted data in the query, the **Append** option will be unavailable
* **If editing a schedule** and Omni detects that the query has changed to include pivoted data, it will change the write mode to **Overwrite**
