Once you’ve saved your form and exited the designer, you will arrive back at the "Forms" page. On this page, click the link in the destinations column of the form you would like to add the destination to.

Note: If there are no destinations added to your account, this button will read "0".

You'll then be brought to the Destinations page. 

Add a SQL Destination

Click "New Destination".

A new page will load, and on it you will see destinations to send your data to.
Step 1: Select the "SQL" destination and in Step 2 select "XML" when prompted to choose a 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

In Step 6 you'll be required to 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".

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.

In Step 7, you have the option to create Destination Rules on when you want the Destination to be active. To learn more about how Destination Rules work, visit our article here.

When you're done, click "Create Destination".

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. 

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 support@devicemagic.com

Did this answer your question?