Now that we have an entity for milk alternatives, we can extend the User wants to order a coffee flow to take the milk alternatives into account and allow conversations like this:
User: I would like to order a medium flat white with soy milk
Bot: Ok, a medium flat white with soy milk will be ready for pickup in 5 minutes.
But if the user doesn't mention an alternative milk type, we'll asume a regular milk will suffice:
User: Can I order a large flat white
Bot: Ok, a large flat white will be ready for pickup in 5 minutes.
Would you know how to proceed?
We will want the 'User wants to order a coffee' flow to pick up a milk alternative when it is mentioned, but not explicitly ask the user for it when it wasn't mentioned. This is a way of keeping the coffee ordering process as seamless as possible, without asking for information that may not be relevant for the majority of users. To achieve this we will make the following changes to the flow:
orderedMilkAlternative
. Give it a default value of ""
.Pick up milk alternative
.%LONGBERRY_MILK_ALTERNATIVES.ENTITY^{orderedMilkAlternative = lob.description}
Ok, a ${orderedCoffeeSize} ${orderedCoffeeType}${orderedMilkAlternative ?: " with " + orderedMilkAlternative} will be ready for pickup in 5 minutes.
If orderedMilkAlternative has a value it will insert with [alternative] into the output.That's it! You can now save the flow and test it in Tryout.
Was this page helpful?