How to automate login with step and a Google Sheet
Several methods exist when you want to automate actions behind a login. The simplest is, of course, sharing your session. However, in this guide, we will show you how to use steps and a Google Sheet to safely store login details. FYI, we do not recommend storing logins directly within steps, although all step data is encrypted at rest and in transit.
Other methods include: Sessions | VPS | 2FA | Password manager | Most secure
# Using a Google Sheet to store passwords
Not everyone will feel comfortable using Google Sheets. However, Google is one of the most secure companies in the world. It operates a vast security network 24/7, and governments and enterprises trust its infrastructure.
# Set up a Google Sheet
Create your Google Sheet and add your login details. Do not share access to the sheet with others.
# In your automation
To automate logging into a web app, open up the step finder at the top of your automation.
Design pattern: Login with steps
- 1 Read data from a Google Sheet
- 2 Go to page
- 3 Enter text
- 4 Enter text
- 5 Click element
How
- Start, by adding a "Read data from a Google Sheet" step and select the sheet with the login details.
- Then a "Go to page" step to load the login page.
- Next, add an "Enter text" step and select the username/password field, then click "Insert Data" and select the Google Sheet; choose the column with the username.
- Add an "Enter text" step and select the password field, then click "Insert Data" and select the Google Sheet; choose the column with the password.
- Finally add a "Click element" step and select the submit button, using the select by text option.
# Looping logins
If you wish to loop through logging into multiple accounts, you can adapt the method outlined above by adding extra steps. Starting with the steps already added, do the following:
Design pattern: Looping Login with steps
- 1 Read data from a Google Sheet
- 2 Loop through data
- 2.1 Go to page
- 2.2 Enter text
- 2.3 Enter text
- 2.4 Click element
- 2.5 Loop through data
- 2.5.1 Add steps here
- 2.6 Clear Cookies
How
- Select the "Go to page", "Enter text" (twice), and "Click element" steps by clicking the select box at the top left corner of the step. You will see a tick. Select all the steps. A dark toolbar will appear.
- In the toolbar, select "Loop". This action will move the chosen steps into a loop step.
- In the "Loop through data" step, select the Google Sheet data to loop through.
- After the "Click element" inside the loop, open the step finder and insert a new loop step. Build out your automation in this nested loop.
- Add a " Clear cookies" step inside the loop at the end. This step logs you out.
# Controlling the number of logins
To control how many times the bot logs in and out, in step 1, "Read data from a Google Sheet", you set the first and last row values. For example, AB1 to AB3 would loop through three rows, reading columns A&B. Thus, the bot would log in to three different accounts.