Version: 22.04
Pages
Pages are the building blocks of the Narrative. The pages in a Narrative directly represent the Pages in the associated Maestro Form. When the Narrative transitions from one Page to the next, so too does the Form UI.
Page Properties
The following properties can be set on any page in the Narrative.
Property | Description |
---|---|
name | String The unique identifier of this page in the Narrative. Used to identify the page and bind it to a Maestro Page . |
condition | Boolean (Default: true )Whether a page can be visited, as well as whether it's visible in the Form UI. If this property's value evaluates to true the page will be accessible, assuming it's one of the next pages of the current Narrative page, and it will be shown in the form navigation. |
allowGoBack | Boolean (Default: true )Whether back navigation is enabled. Use this property to prevent an applicant from navigating back in a form once they've reached a certain point. For example, after calling IDV, which is expensive ($). If this property's value evaluates to false , the back button on the Page and back navigation are both disabled. |
allowCancel | Boolean (Default: true )Whether the user can cancel the application. The Cancel button is visible only on pages where this property's value evaluates to true . When the user reaches a certain point, such as creating an account, it may not be desirable to allow them to cancel the application. |
allowSubmit | Boolean (Default: false )Whether the application can be submitted from this page. The application can only be submitted from pages where this property's value evaluates to true . A basic form sets this property to true on the last page only. |
allowSave | Boolean (Default: true )Whether the application can be saved from this page. The Save button is visible only on pages where this property's value evaluates to true . |
preActions | List<Action> (Default: [] )A list of actions to run before being allowed to transition to this page. These actions are run when attempting to leave the previous page. |
postActions | List<Action> (Default: [] )A list of actions to run before being allowed to leave to this page. |
formActions | List<Action> (Default: [] )A list of form actions that are available to be run on this page. |
nextPages | List<String> (Default: [] )A list of page names of possible next pages. If allowSubmit evaluates to false , nextPages must not be empty. |
externalPageUrl | String Embed an external web page into a Narrative flow. This property's value is either a string literal containing a URL or an expression that evaluates to a URL. Use this property to represent an external URL as a page in the narrative flow. The external page needs a way of redirecting back to the application form to continue with subsequent pages. All properties including condition , preActions , and postActions of the external page are performed as if this was a standard form page. |
receiptVisibility | Enum (Default: history )Determine whether a page is visible on the PDF Receipt. Supported values:
|
milestone | String The name of a Journey Analytics Milestone to be recorded when this page is entered (all pre-actions completed successfully). |
segments | List<InsightsSegment> A list of Journey Analytics Segments (name/value) to record when this page is entered (all pre-actions completed successfully). |
Examples
Property: allowGoBack
{
"name": "Page Without Back Nav",
"allowGoBack": false
}
Property: allowSubmit
{
"name": "Page Without Back Nav",
"allowSubmit": true
}
Property: allowSave
{
"name": "Page Without Save Nav",
"allowSave": false
}
Property: preActions
{
"name": "Page with Pre Actions",
"preActions": [
{ "name": "Action One", "version": "1.0.1" },
{ "name": "Action Two", "version": "2.0.1" },
{ "name": "Action Three", "version": "1.2.1" }
]
}
Property: postActions
{
"name": "Page with Post Actions",
"postActions": [
{ "name": "Action One", "version": "1.0.1" },
{ "name": "Action Two", "version": "2.0.1" },
{ "name": "Action Three", "version": "3.2.1" }
]
}
Invoke a Form Action from Maestro (JavaScript)
/**
* Invokes the actionName provided
* If the action updates the XML then this will be reflected in the form
* @param actionName - Name of the formAction which has been configured in the Narrative. This can either be the real service name or the simple name configured.
* @param params - Javascript map e.g. {"name":"hello","value":"world" }
* @param bypassValidation - skip page validation before making the service call.
* @returns {Promise} - generally contains the Serialized version of the FormFuncResult which is returned to the Maestro form by the Transact Function.
*/
Narrator.invokeFormAction("Service Name or Simple Name",{'param':'value'}, true)
.then(console.log('CS Customer Code Here'))
.catch(Form.showModal('fatalerror'));
note
Params configured in a Narrative take precedence over same key-name params passed in via the JavaScript function.
Don't use
invokeFormAction
with sensitive parameters such as credentials. This is because information passed toinvokeFormAction
is stored in the JM database which is undesireable for sensitive information.This feature requires the services version 1.4.0 or later.
Property: formActions
{
"name": "Page with Form Actions",
"formActions": [
{ "simpleName":"Simple Name", "name": "Action One", "version": "1.0.1" },
{ "name": "Service Name",
"version": "2.0.1",
"params": {
"txn": "${ txn.trackingCode }"
}},
{ "name": "Action Two",
"version": "3.2.1",
"params": {
"txn": "${ txn.trackingCode }"
}
}
]
}
Property: nextPages
{
"name": "Page With Multiple Next Pages",
"nextPages": [
"Next Page One",
"Next Page Two",
"Next Page Three"
]
}
A typical page
{
"name": "A Typical Page Definition",
"allowGoBack": "${ !data.get('primaryApplicant').isIdvComplete() }",
"preActions": [
{
"name": "Action One - With Params",
"version": "1.0.1",
"params": {
"txn": "${ txn.trackingCode }"
}
}
],
"postActions": [
{ "name": "Action Two", "version": "1.0.1" },
{ "name": "Action Three", "version": "2.0.1" }
],
"nextPages": [
"Next Page One"
]
}
Property: externalPageUrl
{
"name":"External Page",
"externalPageUrl" : "http://www.google.com/",
"preActions":[
{
"name":"Sample - Pre Action",
"version":"1.0.0-RC1",
"alwaysProcess" : true,
"params":{
"Sample Key Name":"Sample Test Value"
}
}
]
}
receiptVisibility
{
"name":"Receipt Only Page",
"receiptVisibility" : "always",
"condition": false
}
Property: segments
"segments": [
{
"name": "Segment Name",
"value": "Segment value"
},
{
"name": "Dynamic Segment",
"value": "Segment - ${txn.trackingCode}"
}
]