Toggle menu

Script Action

The script action field type lets you write a JavaScript function that is executed on the server before any site template/framework code. For a more detailed look at the order actions are processed in see the The Form Lifecycle: Control and Action Processing reference article.

All of the helper library functions are available. Form Action Fields and Scripted Actions in the Knowledge Base has examples of scripted actions.

Properties

LabelDescriptionType Name
SummaryA short description of what the field does, displayed in the forms designer to help identify itSUMMARY
Action functionThe JavaScript function that is executed server-side to perform the required action. The Helper Library functions are available for use in this function, including ones that enable use of the iCM API. This very simple example will cause a confirmation message to be displayed:

function( helper, processor, props, context ) {
    return helper.utilCreateConfMessageAction(props["FIELD"]["NAME"], "Thank you");
}
ACTIONFUNC
Stop Processing on ErrorIf true, and an error is encountered, further action fields on the form won't be processed. See The Form Lifecycle: Control and Action Processing for more informationSTOPPROCESSINGONERROR
DocumentationAdd documentation to your field to help explain any complex functionality to future users. You might include information on what the field does and how it relates to other fields on the form. Notes added here are only ever visible in the Forms Designer, they can be searched for, viewed and downloaded from the action panel. See Common Field Properties for an exampleDOCUMENTATION

Action Results

The following can be accessed using .utilGetActionResults once the action has been processed.

"FIELDNAME": {
    "success": "true"
}

Last modified on 8 July 2022

Share this page

Facebook icon Twitter icon email icon

Print

print icon