Expanded support for variables in the Zendesk Bot

Zendesk recently added variables, dynamic options and carousels to their Bot Builder. No better way to showcase these new capabilities than building a bot powered by the Avengers!

Expanded support for variables in the Zendesk Bot

These last few months we've seen the Zendesk Bot evolve from a basic flow builder towards a fully capable conversational bot that can integrate with external APIs, show complex flows and dynamically generate carousels and buttons for customers.

When I wrote my tutorial on a, then, full-featured Zendesk Bot, and consequently wrote about the new Dynamic Conversation experiences and Answers Linking one of the things that popped up was a lack of variable support in the Zendesk Bot.

To give an example: image you're setting up a support bot for a company that has both laptops and mobile phones. When you have answer flows for reinstalling the device, warranty policy and feature tutorials, you need to start each flow with "What device are you using" to make sure you can give the right response.
In an ideal world when a customer talks to your AI Agent, if they tell them "I use a mobile phone" once, that information should be context for every subsequent interaction in that conversation.

Long story short: Zendesk just introduced that capability in Zendesk with their new Set Variable step, while also introducing session variables that live across answers for the duration of a conversation with your bot.

This month's articles are sponsored by Swifteq. Powerful workflow apps that give Zendesk superpowers.

What's New

These last few weeks Zendesk introduced three major capabilities to the Zendesk Bot:

Set Variables

A new step type was introduced 'Set Variable' which allows you to store a piece of data and reuse it across steps and answers.

Additionally, all variables in your answers flows, both those created in Set Variable as those gotten from API calls,Carousels or Option Lists are now accessible in all other subsequent answers used in the conversation.

Announcing answer linking enhancements and passing variables to tags
Announced on Rollout starts Rollout ends April 24, 2024 April 22, 2024 May 3, 2024 In line with our ongoing investment in improving how variables can power automation for our customers, we’re…

Dynamic values in Present Options

When Zendesk introduced their Dynamic Conversation experience late last year, one of the nice additions was the ability to generate carousels based on API data. I used it to generate a carousel of movies in my demo for example.

One weird omission, now fixed, was the ability to generate a list of options (buttons) based on API data. That is now possible with the addition of Dynamic values for both the carousel and now options too.

Transfer values

And the values of variables can now be passed as tags or custom field values when a conversation is transferred to an agent.

Let's make this real

So, how better to test out these new features then by creating a fun new Bot flow!

In this new Answer we'll do the following:

  1. Get a list of Marvel superhero's from an API
  2. Show a dynamic list of options based on the API data with super heroes.
  3. If a customer picks a hero we'll store their chosen_hero and show more data about the character.
  1. We'll then offer the option to show movies that feature that character, and if the answer is yes, we'll link to a new answer flow.
  2. Leveraging the chosen_hero variable we can conditionally show only those movies featuring that character.
  3. And finally we show an option to show all superhero movies. This will reset the variable and reuse the same movies answer to show all hero movies.

You can test the flow via the Messaging button bottom right!

How did I build this?