Selection action is used to send a bot selection message to the user. The selection may be through cards, buttons, or keywords by mapping the user response to one of them.
You can choose optionally a name for your Selection action, and you will need to put a fallback. Fallback is important here cause the assistant should know what to do in case the user writes a response that can't mapped to any button or keyword.
In the case of "Send Card", one or multiple cards can be sent to the user. Each card can have an image, title, subtitle, text, and buttons as next:
The buttons can have multiple types and according to the type you will need to configure different fields, the supported types as next:
- Button: In this case clicking on the button will take only to the next connection, in that case, you will need to configure button text, button action, and button connection. The button text will appear to the end-user and will be written as a user response in case the user clicked on it. In some platforms such as Whatsapp, the user can't click on the button. In that case, using the action will be helpful. You can also use the action instead of the text if the text is too long to repeat it as a user message.
- Link: In this case clicking on the button will open a new page with the link value and will continue to the next action. Instead of action here, the user will need to add Url of that link and will be used to determine the next action according to the clicked link.
- IFrame: In this case clicking on the button will open an iframe in the same chat window with the URL chosen for the iframe.
- Facebook IFrame: Only for a Facebook channel, in order to open the iframe you will need to choose this type
In the case of "Send Quick Reply", a button or multiple buttons directly can be sent to the users. All previous buttons types are supported here too. Also, you can choose optionally a prompt message that can be displayed before the buttons (Some channels do not support prompt messages).
In the case of keywords, you will be able to configure that from the footer of the action menu as of next:
You can define multiple groups of keywords, for each group you will put the keywords that the user mostly will use in his response, and you will choose an action target for this group.
The action may play different behaviors depending on its configuration, and that will be in order as next:
- If selection action contains no buttons or cards with buttons, then the will stop the flow and wait for an input from the user (Mostly in case of selection through keywords)
- If selection action contains one button with link type or one card with one button with link type, the system will send the selection message to the user with that button but will continue the flow and never wait for an input
- For all other cases, the system will send the selection message to the user and will stop the flow and wait for user input
In case of waiting for an input, the selection action will only respond to the text and link click messages, in case of connect message it will do nothing and in case of other types, it will fallbacks. In the case of one of them (text or link clicked messages), the selection processor will behave with the next step in order:
- Will check the user input match in global keywords, and if the match exists it will continue the flow to the connection specified in that global keyword.
- Will check the user input match in one of the buttons data (Either buttons selection message or buttons inside card selection message), and it will check the buttons in the order they defined in the designer page. And it will check the following attributes in order for each button, action, link, and finally text.
- Will check the user input match in local action keywords, and if the match exists it will continue the flow without waiting to the connection specified in that local keywords.
- Will fallback if it couldn't catch any match, in that case, if the fallback count defined it will keep sending the local or global error message until the count is finished then it will continue the flow to the fallback connection.
Defining a delay for this action will delay sending the bot selection message to the user which will conclude delaying the flow to the next module afterward..