Are you struggling to load Inphinity writeback data into your Snowflake environment?
This step-by-step guide shows you how to create a User Defined Table Function (UDTF) in Snowflake that calls the Inphinity API directly. You'll learn how to set up the necessary components and write a Python function that handles the API connection efficiently.
When using Inphinity's default settings, all writeback data is managed through their system. While this provides a convenient API to fetch your data (the same one used with Qlik's REST Connector), getting this information back into Snowflake requires additional steps.
This approach is particularly useful if you:
Before creating your UDTF, you'll need two key pieces of information from the Inphinity.app Cloud UI:
For this guide, we'll use one of the destinations from our Ometis higher education planning demos.
The first step involves configuring Snowflake to communicate with external services. You'll need to create three components:
1. Network Rule - Allows Snowflake to communicate with forms.inphinity.appRemember to grant USAGE permissions on these objects to the appropriate roles. Make sure you set them up with a role that has the correct permissions.
Now for the core functionality. We'll create a User Defined Table Function called GET_INPHINITY_FORM_DATA that:
The header of our function GET_INPHINITY_FORM_DATA will take one parameter FORM_ID and return a table of one column and one row, The RAW_JSON from the API. We will process the response further using SQL for flexibility. The other settings are setup as shown below.
The main function within our Code is as follows:
The code includes some basic error handling as well. Fundamentally the code does this:
Putting this all together, we get a framework we can use to ingest our Inphinity data.
You can call it with an ID you have the secret stored for and view the JSON response:
You can then create a query like the following to process that data:
Since the data is returned in an array of object, we need to LATERAL Flatten the input. We can then do f.value:"COLUMN_NAME" AS xyz to create a table from that data. Below is a sample of the output from this particular endpoint.
While this guide focuses on Inphinity, the same core approach can be applied to virtually any API. The key components remain the same:
This pattern creates a flexible framework for bringing external data into your Snowflake environment.
Implementing this solution offers several advantages:
Need help implementing this solution? We've helped over 250 UK businesses get more value from their data. We specialise in Qlik, Snowflake and Inphinity integration.
Book a demo call today to see how we can integrate your Inphinity data with Snowflake.