Loading...
Loading...
Loading...
You can create a digital bot flow in Architect to schedule an appointment and use the bot flow in an inbound message flow. Create the digital bot within the flow, or create it separately and then call it from the inbound message flow.
This procedure describes how to create a bot for an inbound message flow. In this example, users choose an appointment date and time from a list of time slots that the bot provides. The calendar events are retrieved from a third-party API endpoint that helps in scheduling or booking.
You can create custom actions in Genesys Cloud for use with your data actions integrations. Either copy an existing action (static or custom) to use as a template, or follow these steps to create an entirely new action. When you add an action, you can either add contracts and configuration or import them from another data action.
In Genesys Cloud, use a data action to retrieve the values during the bot conversation. Define the input contract and the output contract. The Output Contract in the data action must match the return message that you configure in your route to endpoint.
To create a data action in Genesys Cloud, complete these steps:
For more information, see Manage individual actions for integrations.
To call a data action from an Architect bot flow, follow these steps:
Flow.availableStartTimes.Flow.appointmentDurations.Prepare a list of timeslot objects to use in your flow by converting the data from your data action.
To read through the retrieved data, use a Loop action:
Flow.loopindex.Count(Flow.availableStartTimes). You can choose any of the variables defined in the Success path of your Call Data Action. Flow.timeslots.AddItem(Flow.timeslots, MakeTimeslot(ToDateTime(Flow.availableStartTimes[Flow.loopindex]), ToDuration(Flow.appointmentDurations[Flow.loopindex]))).Flow.availableStartTimes that matches the current loop index and converts it into a DateTime object. It also takes the corresponding item from the list of Flow.appointmentDurations and converts that into a duration object. Finally, it combines the two into a new timeslot object and adds that object to the Timeslot Collection variable.Flow.timeslots and click Close.If the third-party API encounters an error, the bot flow takes the Failure path of the Call Data Action. Customize the Failure path based on your use case. For example, you can use a Transfer to ACD action to route the interaction to an available agent.
If the request to the third-party API times out, the bot flow takes the Timeout path of the Call Data Action. The data action may succeed on a second or third attempt. To set up multiple attempts, you can place the Call Data Action within a Loop action with a fairly low Maximum Loop Count. Ensure that you also place an Exit Loop action after the Call Data Action.
Even if all timeslots are booked, the Call Data Action takes the Success path because the request is processed successfully. The bot may encounter an error as there are no timeslot values available to power the slot. In this case, the message, Error.Expresson.EmptyCollection, is shown. To prevent this error, you can place a Decision block after the Update Data action (inside the existing Loop action). You can use the Decision block to execute the Ask for Slot action only if there are valid timeslot values available. To find if the timeslots list is empty or not, use the expression, IsNotSetOrEmpty(Flow.timeslots).
Even if all timeslots are in the past, the Call Data Action takes the Success path because the request is processed successfully. However, the bot cannot present a timeslot, which is in the past. To ensure that all timeslots presented to a user are in the future, you can place another Decision block before the Update Data action (inside the Loop action).
The expression, ToDateTime(Flow.availableStartTimes[Flow.loopIndex]) > GetCurrentDateTimeUtc(), helps you to find whether a timeslot is in the past or future date.
You can now call this digital bot flow from an inbound message flow.
Get user feedback about articles.