Action is a specific task that you want to perform in an interaction. You can add multiple actions to the interaction. nativeMsg provides various options to manage each action that you add to the interaction.
- Changing the action name
- Adding conditions
- Validating the settings
- Cloning an action
- Populating an action
- Changing the channel in the action
- Deleting an action
Changing the action name
- On the Bots page, click the interaction.
- Click the action button that you want to add to the interaction.
- On the actions panel, click the gear icon.
- In the pop-up menu, click Change action name.
The dialog box appears to specify the new name. - In the text field, enter the new name and click Save.
Adding conditions
For each action, you can add conditions to control how you want to execute the action. You can also add conditions to decide whether to execute the action or not.
- On the Bots page, click the interaction.
- Click the action button that you want to add to the interaction.
- On the actions panel, click the gear icon.
- In the pop-up menu, click Manage conditions.
The Conditions Management dialog box appears. - Click the Add Condition button.
The new fields become visible to specify the condition details. - Click the Select channel drop-down list and select one or more channels for which you want to create the action.
- Click the Add Comparison button to add the comparison condition.
The new fields become visible to specify the attributes and comparison operator. - In the Attribute name field, enter the attribute that you want to compare.
The attribute name is the one that you have set in the Update Attribute action. For example, username, age, etc. - In the Value to compare with field, enter the attribute with which you want to compare the first attribute.
- Click the Select comparison operator to set how you want to compare two attributes.
For example, Not equal, Is, Equal, Pattern, Less or Equal, Less, and Greater or equal, Greater, Pattern: email, Pattern: phone. - After adding all conditions and comparisons, click the Save button.
Validating the settings
The validation settings are used to validate the attribute after the execution of the action.
- On the Bots page, click the interaction.
- Click the action button that you want to add to the interaction.
- On the actions panel, click the gear icon.
- In the pop-up menu, click Validation settings.
The Attribute Validation dialog box appears. - In the Attribute name field, enter the attribute that you want to validate.
The attribute name is the one that you have set in the Update Attribute action. For example, username, age, etc. - In the Pattern field, enter the regular expression to be used to validate the attribute.
- Click the Execute on validation fail drop-down list, select the interaction that you want to set as a fallback in case the attribute is not validated.
- Click the Save button.
Cloning an action
Cloning an action is creating the exact copy of the action. Cloning saves time in defining all settings again and again.
- On the Bots page, click the interaction.
- Click the action button that you want to add to the interaction.
- On the actions panel, click the gear icon.
- In the pop-up menu, click Clone action.
A clone of the action is immediately created and the cloned action panel is added below the existing action panel. - (Optional) Rename the cloned action panel.
Populating an action
Populating is adding an object that allows generating message items based on data from attribute containing JSON.
Note: This option only available for specific actions, such as message, media, rich card, carousel, and List
- On the Bots page, click the interaction.
- Click the action button that you want to add to the interaction.
- On the actions panel, click the gear icon.
- In the pop-up menu, click Populate.
The Populate dialog box appears. - In the From field, enter the name of the human.
The name of the human attribute containing a JSON array. This array will be iterated to fill the data. You can set a human attribute value using the Update Attribute action or Request action. - In the Attribute field, enter the attribute name.
The name of the attribute that will be holding the current item during an iteration of the array specified in from the property. - Click the Save button.
Changing the channel in the action
You can change the channel for an action to redirect the human to another channel.
Note: nativeMsg currently supports RCS channel for redirection.
- On the Bots page, click the interaction.
- Click the action button that you want to add to the interaction.
- On the actions panel, click the gear icon.
- In the pop-up menu, click Change channel.
The Change channel dialog box appears. - Click the Select drop-down list and select another channel that you want to use for redirecting human.
- Click the Save button.
Deleting an action
You can delete any unwanted action from the interaction.
Note: The action is immediately deleted without any confirmation.
- On the Bots page, click the interaction.
- Click the action button that you want to add to the interaction.
- On the actions panel, click the gear icon.
- In the pop-up menu, click Delete action.
The action panel is immediately deleted.