Button BlockOn Addon

The purpose of this block is to display interactive buttons in documents source block (interfaceDocumentsSourceBlock).

Usage

As shown in the example below, buttonBlockAddon blocks should be placed inside interfaceDocumentsSourceBlock blocks.

Properties

Property Name
Description
Example

Button Name (name)

The label (name) of the button as displayed to the user

"Approve", "Reject"

UI Class (uiClass)

The UI class of the button

“btn-approve”, “btn-reject”, “btn-link”

Dialog (dialog)

Determines if a dialog should be opened after the button is clicked

true, false.

Dialog Options (dialogOptions)

Will be shown only if the Dialog setting is set to true.

  1. Dialog Title (dialogOptions.dialogTitle): The title of the dialog. Example: “Rejection”.

  2. Dialog Description (dialogOptions.dialogDescription): The description of the dialog. Example: “Enter reject reason”.

  3. Dialog Result Field Path (dialogOptions.dialogResultFieldPath): The field which will contain the result value from the dialog. Example: “option.comment”.

API

The API for the buttonBlockAddon features both GET and POST methods:

  1. Example response to the GET request:

{
    "id": "4e43f63f-f2e9-4336-a69e-931ec4aafaee",
    "blockType": "buttonBlockAddon",
    "dialog": true,
    "dialogOptions": {
        "dialogTitle": "Reject",
        "dialogDescription": "Enter reject reason",
        "dialogResultFieldPath": "option.comment"
    },
    "name": "Reject",
    "uiClass": "btn-reject",
}

The response to the GET request includes all block settings.

  1. Example payload for the POST request:

{
  "documentId": "66b2838927c34db3c18e3c49",
  "dialogResult": "Typo in name"
}

Where

documentId - selected document identifier.

dialogResult is used for the dialog only.

Last updated