Insert ui input values into database

Is there a way to write an insert query for snowflake that uses the values from a text input? I’m trying to create a form that would take the values from the text inputs and insert it into a database. I saw that there is a way to write queries using dynamic values, but I haven’t been able to get that to work in this case.

Hi Peter,

Yes, you can create variables to insert dynamic data into your database. So basically, to fetch the details from text input controls we would need to provide a syntax with variables in it in the insert query.

For instance, I want to enter my address, name, and position from a Text Input & Text Area control and insert it into my database. For this sample, my query will be like this:

Sample Syntax: INSERT INTO EMPLOYEE VALUES(’{{name}}’, ‘{{address}}’, ‘{{position}}’)

For string data type: enclose the variable within double curly brackets & quotes like ‘{{name}}’. For number data type: enclose the variable within double curly brackets only like {{emp_id}}.

In the above insert query, I have created 3 variables:

  1. name
  2. address
  3. position

Now while using this connector in the app, the system will provide me an option of dynamically populating values to these 3 variables at the run time. Attached is a sample snapshot for your reference below.

Here, you can either set a static value by directly adding the desired value in the respective text fields in the above snapshot or you can use Use Keywords option to fetch data from a control or app level or an action task variable.

I hope this helps! :slight_smile: