Add a SQL Destination

To set up this destination, go to your Forms page and locate your form. Then, click the settings icon to view the menu and select Destinations. On the following page, click New Destination.

Note: By default, two destinations are added every form created.

Note: Depending on the subscription package you have, your available destination options will vary. Contact your Account Manager or to upgrade.

Step 1: Select the SQL destination

Step 2: Select XML format

You will also see an optional Step 3 to send your images to a service other than Device Magic. If you would like to do this, select from the services provided.

Note: Choosing a service other than None (inline) will result in a hyperlink to the hosted image being placed in the file generated by this destination instead of the actual image. See this help article for more information.

Step 4 will give you the the option to add a Description to your destination. You can also set your destination to be Active or not here.

In Step 5, you will be given the option to download a sample XML file.

Connect your SQL Table

Step 6: Enter your SQL server's details in order to connect. Select your SQL server's adapter (Microsoft SQL Server, MySQL or PostgreSQL) and fill in the database connection details. To select the table in which to store your data click Fetch tables from database.

Note: MySQL servers should support connections encrypted using TLSv1.2 protocol. Our recommendation is MySQL version 5.7 or higher.

A note on the requirements to successfully fetch and deliver to your SQL database:
Check out this article for more information on how Device Magic’s delivery services function, and how that relates to specific IP addresses for those services.

Add Placeholders to Columns

After selecting the desired table, click on Show me placeholders I can use in these fields then add the placeholders that are provided to your table columns.

Step 7: You have the option to create Destination Rules for when you want the Destination to be active. To learn more Destination Rules, visit this article.

Lastly, click the Create Destination button at the bottom of the page.


SQL table column headers must retain their original columns headers when the destination was originally set up. Editing the name/format/casing of a column header after the SQL destination has been created may cause issues.


Repeat Group Limitation

Data associated with a repeat group question will be delivered as a text string containing all entries. Creating separate rows in a SQL DB for each repeat group entry in a submission is currently not supported. 

Repeat Group Workaround 

1. Locate the repeat group placeholders for you SQL destination. 

2. Find the table column you’d like to map the placeholders to on the same page and add the desired placeholder between the start and end of the for loop.
For example:
{%for samples_item in fields.Samples%}{{samples_item.Name}}{%endfor%} 

3. Add a comma after the placeholder, but before the {%endfor%} .
For example:
{%for samples_item in fields.Samples%}{{samples_item.Name}},{%endfor%} 

Repeat steps 2 and 3 for all required columns. 

4. After the submission data is delivered to SQL, use a cross apply function in SQL to create additional rows.

If you have any questions or comments feel free to send us a message at

Other Useful Articles:

Did this answer your question?