Updates the values of all of the fields on a page.
This function can be used to update the values of fields on any page of a form, even if that page hasn't been visited yet (ie doesn't exist in the session).
You must supply the values for all of the fields on your chosen page. For a single page, that will be an object where the keys are the field names and values the values of the fields to insert. For a repeating page, supply an array of objects, where each object represents a page instance - the number of objects should meet the page min-max instance count if validation is enabled.
Values set using this function are submitted with the form even if the page or page instance is never visited by the user.
The function can only be used server side in the control phase (ie in button functions), action phase (eg the script action field) and in server-side validation (make sure to include a check so it doesn't run during client-side validation). It can't be used in a form/page server initialisation handler or in default functions.
As values are set server-side, field handlers of any fields updated by this function are not triggered.
All of the standard form fields submit their values as strings, and the platform expects field values to be strings. When you set a field's value, make sure it is a string or you will encounter errors.
Executed
Server-side only.
Arguments
| Argument | Type | Description |
|---|---|---|
| pageName | String, required | The name of the page to update |
| pageData | Either an object for a single page, or array of objects for a repeating page | The names of the fields to update and the values to use |
Example
Update the values on a standard page using a script action.

function(helper, processor, props, context) {
helper.setPageValues('DEMO', {
'NAME': 'Tim',
'AGE': '44',
'HEIGHT': 'Short'
});
return true;
}
Update the values on a repeating page using a script action.

function(helper, processor, props, context) {
helper.setPageValues('DEMO', [{
'NAME': 'Tim',
'AGE': '44',
'HEIGHT': 'Short'
}, {
'NAME': 'Tom',
'AGE': '43',
'HEIGHT': 'Tall'
}]);
return true;
}
