Skip to main content

Version: 23.10

Form Function

The Form Function command is used to call an arbitrary Fluent Function to perform server-side logic. Generally, Fluent Functions are used on the server-side to call other services in a secure manner. These are functionally equivalent to the legacy Groovy Form Dynamic Data services.

Fluent Functions do not have the formData value populated unless explicitly added by the form developer. Also, these functions will not store any changes to the appDoc or form data automatically. These functions are not designed to perform transaction state changes; if you need to make transaction state changes, use Form Update instead.

Support

Form Function was introduced in Transact Manager 17.10, and continues to be available in later Transact Manager and Journey Manager releases.

Options

All options are optional unless otherwise indicated.

OptionDescription
serviceNamestring

Required. The form action service definition name.

serviceVersionstring

The form action service definition version number.

milestonestring (Maximum length 100 characters)

A transaction milestone event to record with the transaction. For example, "Credit Check:Failed".

Milestones are used to store transaction analytics information only. Do not store sensitive or PII data in milestones.

These milestones are recorded in the transaction history table for business reporting, and are also published to the Transact licensing service to support custom licensing agreements.

Example

An example formFunction command is shown below. Note the form may add arbitrary parameters which can be used by the service.

{
"type": "formFunction",
"requestKey": "96b45311175fc320d875483950b2847c",
"options": {
"serviceName": "IDV Credit Check",
"serviceVersion": "2",
},
"parameters": {
"applicant": {
"firstName": "John",
"lastName": "Doe",
"email": "[email protected]",
"mobile": "0438928123",
"addressLine1": "385 Interlocken Crescent",
"suburb": "Broomfield",
"state": "CO",
"zipcode": 80021
}
}
}

Response

info

The response to this command is based on the standard Open UX API HTTP response. For more information, see HTTP Response.

200 OK

An example response for a HTTP 200 status code is shown below. This response includes prefill data returned by the Fluent Function.

{
"formStatus": "Opened",
"data": {
"products": [
"Master Card Bronze",
"Master Card Gold",
"Master Card Platinum",
"Master Card Plutonium",
"Master Card Unobtainum"
]
}

400 Bad Request

On an invalid response, the server sends a JSON error message.

An example error response where the service is not found is shown below.

{
"error": "service not found",
"errorKey": "stdErrs.serviceNotFound"
}