
The Synerise and Google Sheets integration allows easy data export from Synerise to Google Sheets. Using the "Upload Data to Spreadsheet" node, you can add data as rows or columns to the spreadsheet, including various data types (events and analytics). This integration opens up new possibilities for data analysis and informed decision-making.

This use case shows a workflow configuration that sends daily information from Synerise to Google Spreadsheets about the number of transactions made on the current day, enriched with information about the date of sending this data.

<figure>
<img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/gs-main.png" alt="The view of the workflow"  class="full no-frame">
</figure> 

## Prerequisites
---
- Check the [requirements](/docs/automation/integration/google-sheets/upload-data-to-spreadsheets#prerequisites) you must meet to integrate Synerise with Google Spreadsheets.
- Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://developers.synerise.com/DataManagement/DataManagement.html#operation/CreateATransaction).

## Process 
---
1. [Create a metric](#create-a-metric) that counts the number of transactions.
2. [Create an expression](#create-an-expression) that returns the current date.
3. [Create a workflow](#create-a-workflow).

## Create a metric
---
In this part of the process, you will create a metric that counts the number of transactions completed on the current day and will be sent to Google Spreadsheet.

1.  Go to <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/decision-hub-icon.svg" alt="Decision Hub icon" class="icon"> **Decision Hub > Metrics > New metric**.
2. Enter the name of the metric.
3. As the metric type, select **Simple metric**.
4. As the type, leave **Event**.
5. As the aggregator, set **Count**.
6. As the occurrence type, set **All**. 
7. From the **Choose event** dropdown list, select `transaction.charge`.
8. To select a specific time range, click the calendar icon. In our case, it will be **Today**. Confirm your choice with the **Apply** button.
9. Click **Save**.

    <figure>
    <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/gs_metric.png" alt="The view of the metric configuration" class="full" >
    <figcaption>Configuration of the metric returning the number of all transactions </figcaption>
    </figure>

## Create an expression
---

In this part of the process, create an expression that returns the current date.

1. Go to <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/behavioral-data-hub-icon.svg" alt="Behavioral Data Hub icon" class="icon"> **Behavioral Data Hub > Expressions > New expression**.
2. Enter the name of the expression. 
3. Set the **Expression for** option to **Attribute**. 
4. Click **Select** and from the **Function** dropdown list, choose **Now**.
5. Save the expression. 

<figure>
    <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/gs-exp.png" alt="The view of the expression configuration" class="full" >
    <figcaption>Configuration of the expression returningthe current date </figcaption>
    </figure>

## Create a workflow
---
In this part of the process, create a workflow which adds a new row with the Synerise metric value to a Google Spreadsheet. The workflow starts at 6 A.M. daily and automatically updates the Spreadsheet.

1. Go to <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/automation-hub-icon.svg" alt="Automation Hub icon" class="icon" > **Automation Hub > Workflows > New workflow**.  
2. Enter the name of the workflow.

### Define the Scheduled Run trigger node

1. As the trigger node, add **Scheduled Run**.  
2. In the configuration of the node:  
    1. Leave the **Run trigger** option at default (**all time**).  
    2. From the **Timezone** dropdown list, select the time zone consistent with the timezone selected for your workspace.  
    3. Define the frequency of the workflow. In this use case, it's every day at 6:00 A.M. 
    4. Confirm by clicking **Apply**.

<figure><img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/bq-automation.png" class="full" alt="The configuration of the Scheduled Run node"><figcaption>The configuration of the Scheduled Run node</figcaption></figure>

### Configure the Upload Data to Spreadsheet node

1. As the next node, add **Google Sheets > Upload Data to Spreadsheet**.
2. Click the node and then **Select connection**.
3. From the dropdown list, select the connection.
    - If no connections are available or you want to create a new one, see [Create a connection](/docs/automation/integration/google-sheets/upload-data-to-spreadsheets#create-a-connection).
    - If you selected an existing connection, proceed to defining the integration settings. 
 4. Fill out the **Configure integration** form.
    1. In the **Spreadsheet ID** field, enter the ID of the Spreadsheet to which you want to upload data.
    You can find the ID in the URL of the Spreadsheet, it is the last string of characters.
    2. In the **Range** field, define the range of cells to which the data will be uploaded. The values will be appended to the first empty cell available within the indicated range.
    The value in this field must be given in the A1 notation, for example `Sheet1!A4:A5`, then the data will be added in a column to A4 and A5 cells in the `Sheet1` Spreadsheet.
    3. From the **Dimension** dropdown list, select **Columns**.
    4. In the **Values** field, enter the data you want to upload to the Spreadsheet. In this case:
  
        
   <div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

   In the request body with the values, we use [inserts](/developers/inserts) and Jinjava to refer to the data gathered in Synerise. Make sure to add the id of the metrics and expressions you created earlier.

   </div></div></div>


        
   <pre><code class="language-json">[
   [
       "{% metrics %} example-ID-of-the-metric {% endmetrics %}"    ],
    [ 
       "{% expression %} example-ID-of-the-expression {% endexpression %}"   ]
   ]</code></pre>


        <figure><img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/gs-node.png" class="full" alt="The configuration of the Upload Data to Spreadsheet node"><figcaption>The configuration of the Upload Data to Spreadsheet node</figcaption></figure>

5. Confirm by clicking **Apply**.


### Add the finishing node 
1. Add the **End** node.
2. In the upper right corner, click **Save & Run**.  

<figure><img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/gs_workflow.png" class="full" alt="The configuration of the Workflow"><figcaption>The configuration of the Workflow</figcaption></figure>


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The metric presented in this case is just an example. You can export any other analyses you need with the **Upload Data to Spreadsheet** node. All you have to do is replace the syntax with relevant jinjava inserts and add the corresponding analyses IDs.

</div></div></div>


## Check the use case set up on the Synerise Demo workspace
---
You can check all the configurations directly in Synerise Demo workspace:
- [Metric](https://app.synerise.com/analytics/metrics/be18d6fe-4b3a-45a3-9bd5-08a9a85652c3)
- [Expression](https://app.synerise.com/analytics/expressions/8aed3f3e-f89c-422b-9d23-6609c0ecdee8)
- [Workflow](https://app.synerise.com/automations/automation-diagram/c8171a3e-285c-43f9-9191-94fb16a744c2)

If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace.  

If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. 

## Read more
---
- [Automation Hub](/docs/automation)
- [Automation inserts](/developers/inserts/automation)
- [Uploading data to a spreadsheet](/docs/automation/integration/google-sheets/upload-data-to-spreadsheets)
