In this article
- If you have selected the Format to be Delimited Text File, then the dialog that opens is shown below.
- Formatting- a delimiter is a sequence of one or more characters used to specify the boundary between separate, independent regions in plain text or other data stream. An example of a delimiter is the comma character in a sequence of comma-separated values. Select the delimiter that has been used in the data file to be imported. If you select "Custom", you can then define any single keyboard character.
- Text Qualifier - this property is only available when you select “Formatting: Comma separated”. When "Comma separated" is selected, the comma character has a special meaning; it is used to separate the different values from the different variables. However during export commas will be removed from opentext answers since in this case the character has a different meaning. Adding quotes around an answer text ensures that the text remains unchanged.
- Locale - determines the formatting of elements such as numbers (decimal point) and dates/times. Select the locale appropriate to the format used in the file.
- Is Unicode - enables the software to handle Asian languages. Unicode is recommended for files containing data in languages that use either Unicode encoding or other encoding. The user can choose any language when designing a Survey.
- Codepage - if Unicode is not selected, choose a code page from the drop-down list.
- Truncate Open Ends - for Open Ends (Open Text questions with no field width specified), it is recommended to truncate texts to improve performance. If a number of characters is specified for the Open Ends Width, texts longer than this limit, if any, will automatically be truncated. If No Truncation (Full Length) is selected, the whole text will be imported/exported, but the task will take significantly longer to execute.
- Execution mode - select how the data is to be added to the target database.
- Merge data - all the data from the source will be added to the target survey database. Any records in the source that already exist in the target survey database will be updated, and any records in the source that do not currently exist in the target survey database will be added to the target survey database.
- Append data - any records in the source that do not exist in the target survey database will be added to the target survey database. Any records in the source that already exist in the target survey database will be ignored.
- Update data - any records in the source that already exist in the target survey database will be updated with values from the source. Any records in the source that do not already exist in the target survey database will be ignored.
- Key field - the key field is used as a unique identifier to indicate which records are to be updated and which are to be appended. The key field is also used to map the responses in the top-level file with the responses in loop response files. The key field must exist in both the import file(s) and the database.
- Make the appropriate selections, then click Next.
Figure 1 - The second stage of the Import dialog for a Delimited Text File import
The options are as follows:
You can choose between three modes for importing the data, listed below. In all the modes the user will be asked to provide a key (see Key field below). The keys available are respid, responseid, and any field in the survey database that has an index (go to General for more information). To create an index on a field in a survey database, go to the question properties of the field and set the "Indexed" property (available on single and open text questions with a field width set), and then re-launch the survey. By employing this setting, you can then use for example email address, membership number etc. as a key. The rule executer reads the value of the selected key field in the incoming data file and checks to see if a row with the same key already exists in the target.
In these scenarios, when new records are added, the new records are inserted both in the response data and in the respondent table (respondent list).
System variables respid and responseid and all survey variables with the "Indexed" property set, will be displayed in the "Key field" drop-down. You may choose any survey variable that has a unique value for each respondent as key field. The key field should either be one of the system-provided ids (respid or responseid), or an open text question with a defined field width. Examples of key fields could be membership number, customer id or email address.
Important: The fields respid and responseid are system-provided ids in Authoring. When appending records (inserting records that are not already present) through data import with one of these fields as key field, the system will replace the ids you import with new system-generated ids.