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
- Quickly adpated to suit any web app.
- Add steps to login if required.
# Set up a Google Sheet
- 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.
- Name your sheet something like 'File Uploads’.
- Set up two tabs titled 'Files' and 'Log’.
- 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.
- Sheet name - Choose the sheet tab called 'Files'.
- First cell - If the links are in column a set to 'A1'.
- Last cell - Set to the final colum of data, but on the first row 'AD1' for example.
- 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.
- Go to page, Enter URL - Add the URL of the page you want to upload the files to.
- 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.
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.
- Sheet name - Choose the tab you created called 'Log'.
- DATA - Select the 'google-sheet-data'.
- 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.
- Sheet name - Choose the sheet containg the data to be submitted.
- First row - set to 1.
- 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.
- Jump to step - set the step you want to jump to make the bot loop in this case step one.
- Maximum cycles - set the amount of loops the bot must perform, start with a test run of two-three cycles.
# 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.