Dynamic Quickreplies in the Multiple Choice Box
This feature is only available in Enterprise plans.
Use this feature if you want a Multiple Choice box to show different quickreplies depending on the user or flow. For example, in one chat it may display {Ford, BMW, Fiat}, as shown in the picture, whereas for another chat it may display {Tesla, Ford}.
Specifically, you can set a JSON array field as the first quickreply in a Multiple Choice box, and then during bot execution time, each element of the JSON array will be displayed as a quickreply. Note that there is no way to set separate flow paths based on the quickreply on the Multiple Choice box (this could be done using a subsequent Condition Field).
The JSON array field is typically set using a external API box, placed earlier in the bot flow diagram.
Example
Here is an example of what your external API response might look like. Notice the “quickreplieslist” field in the response. The choices in the multiple choice box will become “Ford”, “BMW”, “Fiat”.
In a Multiple Choice Box, you set a field in the first quick reply. In this example, we set a field called {quickreplieslist} in the first quick reply.
For example, if the field {quickreplieslist} is ['Ford', 'BMW', 'Fiat’] or [Ford, BMW, Fiat] then the replies of the Multiple Choice box will be as shown next.
Note: The default path will be followed.
An External API box can be used to set a value for the field in the Multiple Choice box. In the example above with {quickreplieslist}, we can set it’s value to that of a JSON array.
In order to do this, the response of the API would need to be a JSON response that contains the field as a key and its value as a JSON array, as in this example:
Example JSON Response from an API
{
“quickreplieslist”: [“Ford”, “BMW”, “Fiat”]
}