Import MotionTools bookings from a CSV file received via email

Overview

This article explains in detail how you can set up the workflow in Zapier to connect MotionTools and your email account, enabling the actions to read and parse data that gets sent as bookings into your MotionTools dashboard.

 

Step-by-step guide

Step 1: New Attachment in Gmail

As a first step, set up a trigger to catch new emails from your email account. Select the Gmail app and connect to a Gmail account (or any email provider such as Microsoft Outlook). Make sure that the ‘Event’ selected is New Email.

Zapier_setupgmail.png

In the ‘Trigger’ step, specify the label/ mailbox that should detect new emails in the Gmail app. In this example screenshot, we create a label ‘ZapierTriggers’ to catch all emails containing booking data.

Zapier_step1triggerstep.png

 

Step 2: Utilities in Formatter by Zapier

Once an email with attachment is detected by the Gmail app, the Utilities in Formatter by Zapier action will read the content of the CSV file and forward the data to the next action.Zapier_utilitiesformatter.png

Set up the ‘Action’ step as seen in the example screenshot below.

  • Transform ⇒ Import CSV file
  • CSV file ⇒ 1. Attachment 1 Attachment: (Exists but not shown)

Once this action is complete, run a test for Step 2.

Zapier_step2setupaction.png

In the ‘Test’ action, you will see that the data in CSV is parsed as line_items. We now want to create a booking for each line item in the CSV file.

Zapier_step2testaction.png

 

Step 3: Create Loop From Line items in Looping by Zapier

The CSV file would likely contain multiple rows, but by default Zapier would only read the first row. In order to create a booking for each row, we need to make use of the Looping by Zapier app. Once added as the third step in our zap, we select the Create Loop From Line Items action.

This will facilitate reading all the rows in the CSV file, one by one, so we can create one booking per CSV row, as originally intended.

Zapier_step3app_event.png

Next, map the attributes that you want to use from the CSV file. The attributes from the CSV file will be available to use in the MotionTools app by the new name that you mapped them to in this step.

Below is an example of how you can map the booking attributes to their respective values.

Zapier_step3mapvalues-compressed.gif

In the MotionTools app, we will use these variables to finally create the bookings.

Zapier_step3mapvalues.png

Once the values are mapped, run a test for Step 3 in order to ensure that the values are mapped correctly, and that the data looks good.

Zapier_step3testactions.png

 

Step 4: Create 1-stop/ 2-stop Booking in MotionTools

Select Create 1-Stop Booking or Create 2-Stop Booking in the ‘Event’ field.

Zapier_step4app_event.png

 

In the following step, you will need to set up the MotionTools account to be used in this Zap. See here: Setting up a MotionTools connection on Zapier for a detailed guide on how this is done.

Next, we configure the booking properties in ‘Set up action’ as seen in the example screenshot below.

  • Scheduled at ⇒ Define a scheduled time or leave this field empty to use the first available timeslot
  • Payment method ⇒ Select according to your desired value. If payments are disabled for your account, use ’None’.
  • Additional information ⇒ Additional booking information
  • Metadata ⇒ Optional: Include custom external data (See Metadata)
     
    Zapier_step4action1.png
     
  • Stop type ⇒ Select Pickup or Drop-off
  • Metadata (Stop level) ⇒ Optional: Include external info such as order_id on stop level
  • Coordinates ⇒ Optional field
     
    Zapier_step4action2.png
     
  • Fill in the remaining information either manually or using the data from Step 3.
    • Street
    • Street number
    • City
    • Country
    • Postal code
    • Address additional line
    • Location name
    • Stop contact first name
    • Stop contact last name
    • Stop contact phone number
    • Stop contact email
       
      Zapier_step4action3.png

Finally, click Test action to verify if bookings are successfully created on MotionTools using the test data! This runs the Zap once.

If set up correctly, the Zap will trigger automatically every time a new CSV file of the same format as the one configured above arrives in the designated ‘Inbox+Label’.

Was this article helpful?
0 out of 0 found this helpful

Articles in this section