Message Debugger

This widget is used to inspect the message within an action pipeline. It is mostly used together with the send action invoked from an action pipeline. Refer to the Actions documentation for more information.

Model

{
    "type": "messagedebugger",
    "actions": {},
    "content": {},
    "dataSource": {},
    "editorOptions": {},
    "toolbars": {}
}
Field Description

actions

Optional property, used to configure action pipelines for selected trigger events.

content

Property used to define the content of the message debugger

dataSource

Optional property used to retrieve data from the system

editorOptions

Additional options for the editor. See the editor options for all available options.

toolbars

This property is used to add, customise or hide toolbars. See the toolbars section below.

To see how this works, create a new compilation consisting of the advancedform model shown below. Also add a messagedebugger widget.

{
    "type": "advancedform",
    "actions": {
        "onSubmit": {
            "type": "send",
            "to": "debugger"
        }
    },
    "data": {
        "firstName": "Joe",
        "lastName": "Bloggs"
    },
    "schema": {
        "type": "object",
        "required": [
            "firstName",
            "lastName"
        ],
        "properties": {
            "firstName": {
                "type": "string",
                "title": "First name"
            },
            "lastName": {
                "type": "string",
                "title": "Last name"
            }
        }
    }
}

The onSubmit action is configured to send the form data to the message debugger when the form "Submit" button in the bottom toolbar is pressed. With the default form data in place the following JSON is shown in the messagedebugger.

{
    "payload": {
        "firstName": "Joe",
        "lastName": "Bloggs"
    }
}

Clearing the content

The content of the messagedebugger can be cleared by sending it a message in which the payload contains a content field set to "". For example:

{
    "type": "button",
    "label": "Clear Debugger",
    "actions": {
        "onClick": {
            "type": "send",
            "to": "debugger",
            "message": {
                "payload": {
                    "content": ""
                }
            }
        }
    }
}

DataSource

Refer to the generic widget page for a description of the general principles governing the treatment of data retrieved from a dataSource.

If a dataSource is defined as an object, then the message returned by the data is determined by the type field if it matches the widget type. If this is not the case, then the content field is checked in the payload and merged into the model. In the event that neither the type or content fields are specified, the entire message is assigned to the payload.

Toolbars

The message debugger widget supports multiple custom toolbars. By default, the message debugger has a toolbar at the top widget. For information on configuring custom toolbars, see the toolbars section in the widget documentation.

Tools

The following tools have a default implementation in the message debugger widget.

Icon Name Description

JSON Format

Format

This tool can be used to format the text in the message debugger if required.

Refresh Btn

Refresh

Refreshes the message debugger widget.

Spacer

Defines the spacing between the tools in the widget toolbar and can be customised using the style and styleByTheme properties.