Table of Contents

How to upload a file to Google Drive using Integromat

Alexander Gao Updated by Alexander Gao

Upload a file with Webhook block

Prepare Landbot
  1. Firstly, we have to build a bot flow to collect the file

The information that we collect will be stored in variables, which we will send them to Integromat.

In the example below, we are storing the name input in the variable @file, that we will use later.

  1. Then let's set a Webhook block.

Create Integromat scenario
  1. After set a Webhook block, let's open Integromat:

  1. We need to do is press Create A New Scenario:

  1. Then search Webhook, then click on its icon:

  1. Let's press continue button to move on:

  1. Then it will display this page:

  1. What we should do now is click on Webhooks:

  1. Integromat will ask you to select the type of Webhook, chooseΒ Custom Webhook.

  1. After click on Custom Webhook, a small window appears:

  1. Click on Add button:

  1. Let's give this hook a name:

  1. Don't click on OK yet, as we still have to copy the API address:

Prepare Landbot request to Integromat
  1. Let's get back to Landbot and paste the URL in the Webhook block, in the URL & Method field:

  1. Click on the Customize Body option. Now we are going to set JSON body with the variables we want to send to Integromat.

Here you have an example of the JSON body that we will use with Landbot variables:

{
"file":"@file",
"email":"@email"
}

  1. Then scroll down and go to Test Your Request section of your Webhook block. There you must set (test) values to the Landbot variables that we are using in the JSON body:
What we mean to do is sending request to Integromat, but if we only send with @file, it will be much more complicated. Therefore we sent @file with @email, just for that Integromat could receive our request.
  1. And click on Test the request button:
  1. If you scroll down, you will see the response from Integromat:

  1. As long as the status code is 200, means our request is successfully sent.

In Integromat set HTTP module:
  1. Go back to Integromat, click on OK:

  1. Let's press the add button, to add the module of HTTP:

  1. Click on Get a file:
  1. Click on the URL bar, choose file variable:

Set Google Drive module
  1. Let's press the add button, to add the module of Google Drive:

  1. Choose Upload a file:

  1. After login the account of Google Drive, let's select the folder, in which we want to put file:
  1. Now click on OK:

  1. Let's run the scenario now:

In Landbot complete the chat to upload the file
  1. Let's go back to Landbot and go to Share > Share with a link > Open:

  1. Then complete the chat:

  1. Now let's move to the folder of Google Drive which we selected:

So as we can see, the file has been already put in the folder, the operation is done!

What if I want to name the file?
  1. Also if you want to name the file, for it not shows as just with file.jpg, you can set a name block (related to 1st step):
  2. Then in Customize body of Webhook block, send the code below (related to 15th step):
{
"file":"@file",
"name":"@name"
}

  1. Inside of the Google Drive module in Integromat, click on Map, below file name, delete the default one, add the data we get from Landbot.

How did we do?

Integromat Automation Integration

Contact