Nodes Snowflake

Prerequisites

In this article you'll learn:

Like most nodes, the Snowflake node is divided into two main areas. The larger area on the left is for writing your query and configuring the node and the Preview box on the right lets you test the node with test input data and shows you what the node returns.

Overview of the Snowflake node

First, let's look at the config area on the left.

Authenticating at Snowflake

If you haven't done so, create a Snowflake authentication in FactBranch.

In the Snowflake node, select the "Authentication" tab and select the authentication you've just created.

Writing an SQL query in FactBranch

Write your SQL query in the large area on the left where you can also use placeholders in the query. See the section using placeholders below for more info.

In order for placeholders to be substituted with real data, we first need to define some test data. So let's look at the Preview box on the right.

Test input data

Most nodes use dynamic data somewhere (more on using placeholders for dynamic data in the next section below) and so it's essential to try out your node with input data.

The Input data is just valid JSON and you can edit is as you like. However, you want to simulate the data this node would receive from its previous node (or from the trigger, if this is the first node).

So, ideally you would first capture a real request to the trigger, use it as test output data and then inherit the output data as the input data of the next node.

To inherit the test outputs from the previous node, click Edit next to the Input data title and then hit inherit outputs from previous node. Your test input will update with the outputs of the previous node or trigger.

Using placeholders

To dynamically insert data in your SQL query, you can use placeholders. They beginn with a dollar-sign ($) just like variables in many programming languages.

The input data to this node are stored in the $data variable. Let's say your node receives the following data:

{
  "id": 123,
  "email": "alice@example.com",
  "name": "Alice"
}

And let's say you want to use the email parameter in the WHERE clause of your query. You could have the email inserted dynamically like this:

SELECT * FROM myschema.customer
  WHERE email=$data.email

The value will be inserted at runtime and will be SQL-escaped in order to prevent SQL-injection issues.

If you need to use the dollar-sign ($) somewhere in your query other than in a placeholder, please use the escaped version which is two dollar-signs ($$).

Running a test request

To see the effects of your query, hit the Run button. This will run the node (but only this single node) for real. So if you're updating data in your query, your real data will update.

In the test run it will replace all placeholders with the data you've defined in Input data.

After the request finishes, you'll see the outputs in the Output section. This is whatever the Snowflake warehouse returns and you can work with this data in the next node.

If this is already the final node in the Flow, this output will be returned as the Flow's results.

Renaming the node

To rename the node, either click on Rename next to the title, or double-click on the title itself. Then enter the new name and click on Save or hit Enter on your keyboard. To revert to the old name, hit the Escape key.

Below the Preview box you find the quick navigation through the Flow. Use this to get to the previous or the next node.