The Handle Data script handles field mappings between ServiceNow and a PDF Form Field. the script is used to load data into the form, refresh the data on the form, and save the form data back to ServiceNow.
the following variables are provided to the script.
export interface IAction {
action: 'LOAD' | 'SAVE' | 'REFRESH';
init?: boolean;
}
The return value should be set to the result variable. the following is the basic
structure this script should take. For more info see Handle Data Helper.try{
// Insert mapping code here
if (action.action === 'SAVE') {
result.fields = helper.saveFields();
} else if (action.action === 'REFRESH') {
result.fields = helper.refreshFields(targets);
} else {
result.fields = helper.getFields();
}
result.success = helper.getSuccess();
result.errorMessages = helper.getErrorMessages();
result.customData = helper.getCustomData();
} catch(e){
result.error = e;
}
There is a helper class provided to the handle data script used to facilitate mapping data between ServiceNow and a PDF Form.