How to automate uploading files from a Google Sheet

Learn how to build a bot that automates uploading files from a Google Sheet into any web page. Just install this template and follow the design pattern in this guide.

Currently to upload files you must use the Desktop Application.

# Advantages to following this design pattern

  1. Quickly adpated to suit any web app.
  2. Add steps to login if required.

# Set up a Google Sheet

  1. Create a new Google Sheet. You can do this in your Chrome browser by entering the shortcut 'sheet.new', presuming you already have an account.
  2. Name your sheet something like 'File Uploads’.
  3. Set up two tabs titled 'Files' and 'Log’.
  4. In 'Files' add some data including file paths.

# Install the Upload files template

Just click 'Install template'. If you are a new user you will be required to create an Axiom.ai account before you can edit the template.

# Get started open the bot for editing

On the Axiom dashboard, hover over the text 'Change actions with condition' and click.

# Set up the 'Read data from Google Sheet' step

Connect your Google Sheet to Axiom for parsing.

  1. Spreadsheet - In the field called 'Spreadsheet', you can search for the Google Sheet you created. Once found, click to select.
  2. Sheet name - Choose the sheet tab called 'Files'.
  3. First cell - If the links are in column a set to 'A1'.
  4. Last cell - Set to the final colum of data, but on the first row 'AD1' for example.
  5. You should now see a preview of the data.

# Set up the 'Interact with a page's interface' step

This step uploads the file. Add additional Sub-steps if you need to click on buttons etc.

  1. Go to page, Enter URL - Add the URL of the page you want to upload the files to.
  2. Upload a file, File Input Field select the file input filed on screen. File Path - Click 'Insert data' choose '[google-sheet-data]' and select the colum with the file path.
axiom.ai Interact step upload a file

Top tip: If you need to log in, add an 'Interact' step above the 'Read from a Google Sheet' step. The login will then be outside of the loop.

# Set up the 'Write Data to a Google Sheet' step

This step makes a record of the upload.

  1. Spreadsheet - In the field called 'Spreadsheet', you can search for the Google Sheet you created. Once found, click to select.
  2. Sheet name - Choose the tab you created called 'Log'.
  3. DATA - Select the 'google-sheet-data'.
  4. Clear data before writing | Add to existing data - Set this option to 'Add to existing data'.

# Set up the 'Delete rows from a Google Sheet' step

The 'Delete' step removes the completed row. So next time the bot loops, it will read a new row of data.

  1. Spreadsheet - In the field called 'Spreadsheet', you can search for the Google Sheet you created. Once found, click to select.
  2. Sheet name - Choose the sheet containg the data to be submitted.
  3. First row - set to 1.
  4. Last row - set to 1.

# set up the 'Jump to another step' step

This Step controls the number of loops. To loop from a new row, follow the settings below.

  1. Jump to step - set the step you want to jump to make the bot loop in this case step one.
  2. Maximum cycles - set the amount of loops the bot must perform, start with a test run of two-three cycles.
Axiom.ai loop with jump step

# Test run

We always recommed doing a test run - try just two cylces in the jump step as mentioned.

# Troubleshooting the file upload bot

Try the following if your bot is not working. We would also recommend you watch the video to troubleshoot.

  • File not uploading, Re-select the input field in the 'Enter Text' step.
  • File not uploading still, Check the video format is valid.
  • Nope file still not uploading, check the file path and folder permissons on your computer.
  • The bot loops through the same row. Check you are jumping back to the 'Read Data' step.
  • The bot is still looping the same row. Check the delete step is set up as described above.

# More design patterns