Back to Blog

How to let your bot handle images in 3 steps

A chatbot can do much more than answering simple FAQs. Ever thought about letting the bot handle images that are being sent by the user? It can be very helpful if the user can simply upload a picture of a payment receipt. Let’s have a look at how we can handle those images.

1. Create an entry point

Users don’t just randomly upload an image. We need to instruct and prepare the user to upload a picture or image. A common case is when a user asks if there is any warranty. In most cases, there is, but the organization needs a payment receipt. We can ask the user if they have a payment receipt. If so, we can start ‘upload receipt’ procedure.

Handle Images

2. Handle the images

After introducing the user to uploading an image you can now ask them to upload the image. Drag and drop a trigger/image onto your canvas. Also, create a branch that will work as a fallback. If the user can’t find the image or for some reason is unable to upload it, always provide a solution.

3. Handling images with code

The uploaded images will be hosted in the cloud with a specific url for reference. In the example below, we will show how to send the image url to a pre-defined email address by using Actions.

async payload => {
  var image = "-"
  // Check if the param "image" exists
if(Array.isArray(payload.params.image)) {
 var image = payload.params.image[0].value
  to: '[email protected]', // <-- Your email address
  subject: 'New image via chatbot',
  message: `image url: ${image}, <br/>`

Go beyond simple automation

When you’re confident with the procedure above you can bring image extraction to the next level by incorporating:

Get StartedContact us