Dataset publishing allows you to publish form data to a server dataset. This can be helpful when you want to use data from one form to another, or use the data collected in a previous visit using the same form. For example, you may have gathered household information at an earlier date and now want to pull that data into a form that gathers health-related information from some members of the household.
You will need to have created a server dataset.
These steps repeat the actions that were taken in the video above.
- Log into your SurveyCTO server console.
- In the Design tab, go to the server dataset that you want to receive the data and click Publish into.
- Click + Add a form.
- From the dropdown list, select the form you would like to publish into this server dataset.
- To the right of Field mapping, click + Add.
- You will now specify which form field publishes to which dataset column. You must add at least one field in order to publish into the dataset:
- In the left dropdown menu, select the form field you wish to publish into the server dataset.
- In the right dropdown menu, select the server dataset column you want that field to publish into.
- In the center dropdown menu, select a publishing option:
|Replace - Replace the existing value with the new incoming value.|
|Add - If the value is numeric, you can add the incoming value to the existing value and publish the sum.|
|Concatenate - Concatenate the incoming value to the existing values, creating a list of all published values separated by the separator of your choice.|
- [Optional] Specify any of the below optional settings:
- Form field to identify unique records: This will define the unique identifier of your server dataset. When publishing data, if the unique identifier already exists in the server dataset, the newly submitted values will update that row. Otherwise, it will add a new row.
- Include form submissions whenever this field is 1: Allows you to publish data to the server dataset conditionally, by giving the specified field a value of 1.
- Publish existing data? Data that has already been collected can be published to the server dataset.
- Click Save.
What is a server dataset?
A server dataset is a repository of data on your SurveyCTO server, which is stored in a table, just like a CSV or spreadsheet, so it has rows and columns.
Why would I want to use a server dataset?
Server datasets are a powerful tool to support more complex data collection workflows. They can be linked to one or multiple forms, allowing a two-way data flow between them - you can publish form data and pre-load data from server datasets. This feature will be essential if you are looking to use data from one form to another or assemble data from multiple forms.
What is the difference between Wide and Long Format?
Wide and Long format publishing options are related to data gathered in repeat groups:
- Wide format: each form submission adds or updates one row of the server dataset.
- Long format: each form submission can update multiple rows of the server dataset using a repeat group. Each instance of the repeat group will add or update a different row of the server dataset.
To learn more about Wide and Long format, see this documentation.
How can I pre-load server dataset data into my form?
To pre-load data from a server dataset you need to attach your server dataset to your form. In the Design tab, scroll to your server dataset and click Attach. Then, select your form and click Close. Once the server dataset is attached to your form, you can map the data to the form fields using the pulldata() function. You can also create choice lists for multiple questions using the search() function.
Do I need an internet connection for dataset publishing to work?
Using our standard subscription, internet connection is required for you to leverage from dataset publishing fully. Dataset publishing is only completed once the submission is sent to the server and updates the server dataset accordingly. At the same time, if you are pre-loading server dataset data, you can only pre-load the latest data once you download and install the latest version of your form (with the latest version of the server dataset). Both of these actions require internet connection. If you are interested in setting up a 100% offline workflow, this is possible by enabling our Advanced offline features.