/
Build Guide: Anything Else Loops

Build Guide: Anything Else Loops

Quick links in this article:

This article will outline exact steps for creating an ‘Anything Else Loop’, as part of an automation journey. Refer to Building A Chatbot: Flows for more information.

Check Current Pathway

Navigate to the builder and start by giving your flow a name, then hitting File>Save. You’ll be able to keep saving your flow as you progress, to avoid losing progress.

Much like the Pathway: X flows, you’ll need to start out by adding a Decision as your first action. This is going to check if the current value for Chatbot Pathway custom field matches Anything Else. If another path is active, it will go on to check any subsequent pathway flows instead.

image-20250304-100238.png
Start by checking the current pathway is set to Anything Else

Check Step

On your Active Path branch (Anything Else, in this case) you’ll be adding a Check Step Decision action. This will split your flow based on the current value of your Chatbot Journey Step custom field. To do that, set the condition for the first branch as Chatbot Journey Step equals 0. As previously, you’ll need to find that custom field in Interaction.Data.

Then go ahead and click + Add to get another branch for Step 1. That’s all you’ll need for this flow!

Alternatively, if you Saved your Check Step Decision action in a previous flow you could insert it here, to save some time.

add step decision.gif
Add a Check Step (Decision) action

Branch 0

On Branch 0 of an Anything Else loop, we’re assuming the conversation has reached a natural end. For example, this might be the chat so far:

Chatbot: How can I help today? [Returns] [Tracking] [Website issue]

Customer: Tracking

Chatbot: No problem, please can you confirm your order number?

Customer: ORD-123456

Chatbot: Got it! I’ve located that order for you. Looks like that’s out for delivery today, by 2pm.

Instead of simply closing the chat immediately, we’d like to immediately follow-up with a question like:

Chatbot: Is there anything else I can help you with today? [Yes] [No]

To do that, we’re going to:

  1. Add a Send Autoresponse action to the branch, with quick reply buttons for Yes and No

  2. Use an Update Interaction action to set the Chatbot Journey Step to 1

  3. Stop Processing in the Stop action

anything else.gif
Add an Anything Else autoresponse

With that done, your flow so far should look like this:

image-20250304-101920.png
Your flow so far, with branch 0 complete

Branch 1

In this branch, we first need to identify the customer’s selection from Branch 0 - either Yes or No! The quickest way to do that is to reopen the corresponding Send Autoresponse action and click the ‘Copy to decision’ button. This will auto-generate a Decision into your action library, ready to insert on Branch 1.

check yes or no.gif
Use a Decision to check the Echo.Body (Message) for a match

Branch 1: Yes

If the customer has selected ‘Yes’, then we’ll need to do a few things:

  1. Use Send Autoresponse to present exactly the same Welcome Options you sent in your Chatbot Starter Flow i.e. No problem! Please select an option: [Returns] [Tracking] [Website issue]

  2. Update the Chatbot Pathway to Reset and Chatbot Journey Step to 0

  3. Stop processing in the Stop action

present options.gif
Send an autoresponse with exactly the same quick reply buttons as your welcome message

Branch 1: No

If the customer has selected ‘No’, then we’re going to do the following:

  1. Send a closing messaging like No problem, thanks for chatting today. The conversation will be closed shortly. using the Send Autoresponse action, with a 5 second delay to avoid closing the chat before the message is read!

  2. Use Close Conversation to close the chat - if a post-chat survey is configured on the account, this will be presented automatically.

  3. The chat might be closed, but the interaction is still on your queue! Use Update Interaction to change the Status custom field to Closed and Chatbot Journey Step to Complete.

close and wrap up.gif
Close the conversation, and the interaction!

Error Handling

So far, your flow should look like this:

image-20250304-104057.png
The Anything Else flow so far

We’ve not handled here what to do if the customer should type their response, instead of selecting Yes or No from the buttons. For example ‘I don’t need anything thanks' wouldn’t trigger either of those closing branches. So, let’s send an error message like this:

Oops, I'm just a chatbot! Please select a button to continue: [Yes] [No]

Then, as we don’t want to change the journey step, we can simply set the Stop action to stop processing.

error handling.gif
Add an oops message and resend the Yes or No options - don’t change the step this time!

Save and Publish

image-20250304-104637.png
A completed Anything Else loop

Hit File>Save and File>Publish, then attach your new flow to your Response Received event then head to your test environment to see how it looks on the front end!

Ensure this flow is placed below your Pathway: X flows, so that it always runs after them.

 

Related content