Auto-complete import/update specification
Use this import specification when Automatically completing surveys per the instructions in Auto-completing after a specific page. This updates records based on the survey ID, and:
-
Sets the Survey status (e_status) field to 0 (
COMPLETION_PENDING) to allow for Alert processing. Alternatively, set the status to 1 (COMPLETED) to skip Alerts. -
Sets the Auto-completed flag to Yes to identify the field as having been automatically completed.
-
Sets the Auto-completed date to the current timestamp.
Add other fields/columns as necessary, such as fields whose value might be necessary for alert processing.
<import-spec name="SURVEY UPDATE: Auto-completion of surveys"
description="An auto-generated spec to deal with survey">
<input-column heading="a_surveyid" />
<input-column heading="a_last_seen_page_name" />
<input-column heading="e_creationdate" />
<input-column heading="e_invitationdate" />
<input-column heading="e_status" />
<output-column-group pluginName="Survey" recordUpdateMode="UPDATE">
<!-- Update record based on survey ID -->
<output-column>
<input-column heading="a_surveyid" />
<target-field fieldId="surveyid" fieldName="Survey ID"
requiredness="REQUIRED_USED_FOR_DUPLICATE_CHECK" type="INTEGER" />
</output-column>
<!-- Map Survey status to 0 (COMPLETION_PENDING) to trigger alert processing before becoming 'Completed'; map this to 1 (COMPLETED) to skip alert processing -->
<output-column>
<constant value="0" />
<target-field fieldId="e_status" fieldName="Status" requiredness="OPTIONAL" type="ENUMERATED">
<enumerated-field-parse-options mappingKey="SEQUENCE_NUMBER" />
</target-field>
</output-column>
<!-- Set the AUTO-COMPLETED flag -->
<output-column>
<target-field fieldId="e_company_auto_complete_yn" fieldName="Auto-completed record"
requiredness="REQUIRED" type="ENUMERATED">
<enumerated-field-parse-options mappingKey="NAME" />
<javascript-transform><![CDATA[
return 'Yes';
]]></javascript-transform>
</target-field>
</output-column>
<!-- Mark date stamp for when auto-completed -->
<output-column>
<target-field fieldId="e_company_auto_complete_date" fieldName="Auto-completed date"
requiredness="REQUIRED" type="DATE">
<date-field-parse-options format="dd/MM/yyyy" />
<javascript-transform><![CDATA[
var now = new Date();
var thisyear = now.getFullYear();
var thismonth = now.getMonth()+1;
var thisday = now.getDate();
return thisday+'/'+thismonth+'/'+thisyear;
]]></javascript-transform>
</target-field>
</output-column>
<!-- Map response date -->
<output-column>
<now />
<target-field fieldId="e_responsedate" fieldName="Responsedate" requiredness="REQUIRED" type="TIMESTAMP">
<timestamp-field-parse-options format="yyyy-MM-dd HH:mm:ssZ" />
</target-field>
</output-column>
</output-column-group>
</import-spec>
