Dealing with multimedia content in messages using Flow Builder

When working with conversations in Flow Builder, your customers might send you a message that contains multimedia content instead of just plain text. When this happens, your flow needs to know how to hand the specific type of multimedia content it has received.

In this guide, we'll show you the following:

  1. Handling multimedia content in trigger messages.

  2. Handling multimedia content in reply messages.

  3. A template flow that you can use to start handling multimedia messages (scroll to the end to download).

1. Multimedia content in trigger messages

If you’ve created a flow that starts with the Omnichannel trigger, your customers can trigger that flow by sending you a message that contains multimedia content.

If you’re expecting that the first message your flow will receive will contain something other than plain text, you can use the {{conversationMessageType}} variable to check the type of content.

Depending on the type of content the flow receives, additional variables will become available:

Text

If the message content is text, you can access the content via the following variables:

{{incoming message}} 

OR

{{payload}}

Image

If the message content is an image, you can access the content via the following variable:

{{messageImage}} 

Video

If the message content is an image, you can access the URL of the video via the following variable:

{{messageVideo}} 

Audio

If the message content is audio, you can access the URL of the audio file via the following variable:

{{messageAudio}}

Location

If the message content is a location, you can access the latitude of the location via the following variable:

{{messageLat}}

And you can access the longitude of the location via this variable:

{{messageLong}}

Email

If the message content is email, you can access the email via the following variable:

{{messageEmail}}

Other content types

For other content types, such as a JSON object, you can access the raw message content via the following variable:

 {{conversationMessageContent}}

2. Multimedia content in reply messages

If your flow includes a Wait for response step, you might expect a customer to reply to that step with a message containing multimedia content. In this case, you can check this against the {{reply.conversationMessageType}} variable.

Depending on the type of content the flow receives, additional variables will become available:

Text

If the message type is text, you can access the content via the response variable defined in the wait for response step.

Image

If the message type is an image, you can access the URL of the image via the following variable:

{{messageImage}} 

Video

If the message type is a video, you can access the URL of the video via the following variable:

{{messageVideo}}

File

If the message type is a file, you can access the URL of the file via the following variable:

{{messageFile}}

Audio

If the message type is audio, you can access the URL of the audio via the following variable:

{{messageAudio}}

Location

If the message type is a location, you can access the latitude of the location via the following variable:

{{messageLat}}

And you can access the longitude of the location via this variable:

{{messageLong}}

Email

If the message type is an email, you can access the email via the following variable:

{{reply.conversationMessageContent}}

3. A template flow for using multimedia content variables in Flow Builder

One of the most common ways you'll find yourself using multimedia content variables in Flow Builder is to branch your flow based on the type of content you receive so that your flow can handle each type of content appropriately.

We've put together a template flow (attached at the end of this article) that you can use to set up branching based on the type of content that you receive.

Last updated