# Snowflake Workflow

By integrating Qwary with Snowflake, businesses can effortlessly import valuable data encompassing product feedback, customer queries, user information, and more. After successfully loading the Qwary data into Snowflake, companies can merge it with their existing data and conduct comprehensive analysis for enhanced utilization.

**Qwary's Snowflake integration helps with**

1. Insert/Update response data from Qwary into a Snowflake table
2. Map NPS/CSAT/CES score into Snowflake

**Steps to Connect Qwary to Snowflake**

1. Go to Menu --> Workflow and use the existing event-based workflow or create a new event-based workflow.
   * To create a new workflow, click on 'Add Trigger' and choose the survey whose response you wish to map to a Snowflake table.
2. Click 'Add Task' and click 'Snowflake --> Execute a query in Snowflake to update/insert response data" connect button.

<figure><img src="/files/RDUNb0WJqlUwFP7zn6Dr" alt=""><figcaption></figcaption></figure>

3. Enter Snowflake Connection Details

| Field     | Value                                                                                                                                              |
| --------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| Username  | Your Snowflake account's username                                                                                                                  |
| Password  | Your Snowflake account's password                                                                                                                  |
| Account   | Your Snowflake account's account identifier. Refer "<https://docs.snowflake.com/en/user-guide/admin-account-identifier>"                           |
| Warehouse | Your warehouse name. You can find it under your Snowflake account and go to Admin --> warehouse --> warehouse name![](/files/DCZLJcw3gxU6z2C7phYx) |
| Database  | Snowflake database name, which contains table and schema where you want to map response data.                                                      |
| Schema    | Snowflake database name, which contains a schema where you want to map response data.                                                              |

4. Once your account is connected, Qwary works with SQL. Snowflake supports standard SQL lanauge. Write a query that you would write to insert/update the data into the table. Below example inserts a new record for each new response into customer\_satisfaction table which is inside acmeinc\_db (database) & prod (schema).

**DML for customer\_satisfaction table**&#x20;

`create table customer_satisfaction ( nps_score NUMBER, comment TEXT, customer_email TEXT )`

Sql will look like below screenshot. Use 'PIPE DATA' to insert data into the sql. You can select from survey question, survey variable and contact details when piping the data into sql.&#x20;

<figure><img src="/files/jqkcRSSTQWAvIvHjgQMP" alt=""><figcaption></figcaption></figure>

Once completed, click on 'SAVE' button and activate your workflow.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.qwary.com/product-guide/workflows/snowflake-workflow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
