Toggle menu

Form Message

In your form designs you'll often need to request data from other parts of the platform, or from third party services. To keep those integrations secured, they will generally only be available to server-side actions in your form, for example in field default functions when a page loads, or script actions when a page is submitted.

This field can be invoked browser-side, after the form has rendered, and securely perform requests to server-side functions. That allows you to access data and perform actions that would otherwise require a page refresh.

Request Function

When the field is invoked, this function takes the parameters passed to the field, allows you to update them, then makes a secure request, returning the response to the response function. As it is executed server-side, you are able to access variables etc that are not present on the browser.

For example, this function calls an end point deployed to the server library. The parameters are passed to it by the field invoking this message field (see making a request below).

Form Message - Request Function

function(helper, params) {
    let updatedParams = helper.utilServerAPIServerCall('serverlibrary', 'tim.icmapi.CSObject_get', params);
    return updatedParams;
}

Similarly the function itself could be fairly agnostic, and have the end point to call passed to it:

Form Message Request

function(helper, params) {
    let updatedParams = helper.utilServerAPIServerCall('serverlibrary', params.endPoint, params.params);
    return updatedParams;
}

Making a Request

Requests are made by invoking the field's custom function makeRequest using .invokeCustomFieldFn.

In the first example above, the end point expects a parameter called "label". In a script button (or similarly in the handler of another field) you could do something like this to fetch the value of a field, pass it to the message field, which will then securely call the end point:

Make Request

function(helper) {
    helper.invokeCustomFieldFn('CALLEP', 'makeRequest', {
        label: helper.getFieldValue('TEXTINPUT')
    });
}

Or in a field handler calling the second example above:

function(helper, fieldName, value, valid, eventName) {
    if (eventName == 'CHANGE' && valid) {
        helper.invokeCustomFieldFn('CALLEP', 'makeRequest', {
            endPoint: "tim.icmapi.CSObject_get",
            params: {
                label: "123456"
            }
        });
    }
}

Response Function

The response function is optional - you may want to use the message field to pass data to something server-side without a response.

This example shows how to save the response as a form variable. The value is the response from the request function:

Response Function

Properties

LabelDescriptionType Name
SummaryA short description of what the field does, displayed in the forms designer to help identify itSUMMARY
Request FunctionThis function is executed server-side by the form message. It is supplied with two parameters, a reference to the helper library and the current value of the message body. This should always be at least an empty object, never null or undefined.

The value of the params object will be provided by the calling code within the form. For example:

function (helper, params) {
    // Multiply 2 numbers together
    return params.firstNumber * params.secondNumber
}
REQUESTFUNCTION
Response FunctionA JavaScript function called following a request.

The 'valid' parameter will indicate if the request completed without error. The 'value' parameter will contain the returned data. In most cases this will be a JavaScript object or array. For example:

function (helper, value, valid) {
    if ( valid ) {
        helper.setFieldValue( "RESULTS", "Message successful: " + JSON.stringify(value) );
    } else {
        helper.setFieldValue( "RESULTS", "Message ERROR: " + JSON.stringify(value) );
    }
}
RESPONSEFUNCTION
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
Last modified on 2 October 2026