Skip to content

Request Entity by Name

Category: Variable Manipulation

Description: Extension module that allows invoking a request for an entity from the client through configurable fields.

Functionality: Use this extension module to invoke a response request from the client via an entity. These can be specific data, such as phone number, ID, message, survey, etc.

Implementation

Entity Presentation Style: A dropdown field allows you to choose the presentation style in which the entity will be shown to the user.

  • Selecting Default will display the entity in the default view format.

  • Selecting Menu will reveal two additional optional configuration subsets: WhatsApp Menu Presentation and Necessary Configuration for Enhanced Menu. You can find more details about configuring these options HERE.

The name of the entity obtained from an expression: A string field allows you to enter an expression that you want to evaluate. It can be completed with an entity or text, which must be enclosed in single quotes to be recognized as such.

Allow null or empty value obtained from an expression: A Boolean field allows specifying whether the client can enter blank data for the created entity. If false is entered, the client must provide data, and if not, it will be considered an error. If 'true' is entered, the client can leave the data request blank.

Maximum failed attempts obtained from an expression: An integer field defines the number of failed attempts allowed for the client. For example, if configured as 3 failed attempts, the client will have three opportunities to enter the correct data requested.

Invalid value message obtained from an expression: A string field allows defining a message in single quotes that will be displayed when the client enters incorrect data.

Example:

‘The entered data does not correspond to the request, please try again.’

Json to define the validations that will be applied to the requested entities on supported channels: An expression is defined in JSON format, which will contain validations on the created entity; these may or may not be executed according to the configured criteria. This configuration is only valid for date type entities.

Example:

{
    "validationType": "datetime",
    "weekdays": ["mo", "tu", "we", "th", "fr", "st", "su"],
    "disableCurrent": false,
    "disableBefore": 1,
    "disableAfter": 0,
    "disabledDates": ["2022-06-14", "2021-12-31"],
    "interval": 5,
    "hourBefore": 0,
    "hourAfter": 1,
    "days": {
        "mo": [{
            "start": "15:00",
            "end": "17:00"
        }],
        "tu": [{
            "start": "08:00",
            "end": "09:00"
        }],
        "we": [{
            "start": "08:00",
            "end": "22:00"
        }],
        "th": [{
            "start": "08:00",
            "end": "09:30"
        }],
        "fr": [{
            "start": "08:00",
            "end": "09:30"
        }],
        "st": [{
            "start": "08:00",
            "end": "22:00"
        }],
        "su": [{
            "start": "08:00",
            "end": "22:00"
        }]
    }
}

If the maximum number of failed attempts is reached, the action flow will be interrupted, and the error description will be passed to the selected intent named 'Request_Entity_Error': A dropdown list where you must select the name of the intent for error handling. When an error overflow occurs, the entity Request_Entity_Error will be loaded with the error details if available.

Implementation Example

The example involves requesting the selection of an option

Field Value
Name Survey1
The name of the entity obtained from an expression 'survey_1'
Allow null or empty value obtained from an expression false
Maximum failed attempts obtained from an expression 3
Invalid value message obtained from an expression 'error'
If the maximum number of failed attempts is reached, the action flow will be interrupted, and the error description will be passed to the selected intent named 'Request_Entity_Error' Error_Handler

Below is the result of implementing this extension module: