What’s the difference between exporting and importing data from Google Sheets?
Unlocking the Power of Google Sheets: Understanding the Difference Between Data Import and Trigger.
Let’s start with any automation.
In this article we will go over how to send data from your Automation
to your Google Sheets
and how to use import the information scraped from your automation. First click View
on the Automation
you wish to connect your Google Sheets
.
Exporting data to google sheets
When your automation uses any scrape
¹ steps you can export this data to your google sheet. For example, in this automation I was scraping twitch information with scrape list
¹ so whenever I run my automation it will post the scraped data to my google sheet at the next available row. Once we’re good with the information we scraped we can Stop
² the recording.
Once you finished recording your automation you might see this pop up, it’ll ask you if you want to export data to a Google Sheet¹
or to a Webhook. For this tutorial we are going to use Google Sheet
¹.
Or if the pop up doesn't show click Send to Google Sheets
¹ at the bottom right side.
You will be prompted to connect to a Google Sheet
via URL to send the data to this sheet.
Once you connect your sheet, double check that all the information is correct. If everything is correct, click on Looks good
¹.
And you are all set. Once you’ve clicked on the Play steps
¹ button, you’ll see the automation work its magic!.
When you see the Complete message
¹, it means that all the information you scraped has been stored in the Google Sheet you selected.
The headers Cat
¹ and Links
¹ have both a Text
¹ and a URL
¹ because we Scrape: List "Text"
¹ and Scrape: List "URL"
¹ on that same list element. On Views
², you can see the "Text"
² of how many views each category has because we only Scrape: List "Text"
². Lastly, we have with no
header just chatting
³, which is the element we just Scrape: Text
³. If you want more information on this topic, please read. Scraping a list vs individual text
Importing data from Google Sheets
When you connect google sheets to your trigger you are able to provide variables by creating headers (the first row of your google sheet). Lets say we want to enter the URL’s
¹ we scraped so we can get more information on the page.
Where is the Setup trigger found?
You’ll open the automations view page. On the top right corner you’ll see the Setup trigger
¹ button. This tools will be responsible for settling up schedules, responsible for looping data
, importing data from Google Sheets trigger or Webhook.
Types of Triggers
Once you click on the button, you'll see a page with four big boxes. Each box is a type of trigger. The trigger we want to use for this is the Loop
¹ option.
Loop Trigger.
The purpose of a Loop
trigger is to run your automation using Google Sheet
data for a specific amount of data or to scrape a ton of data over and over again. For example your automation may take data from a Google Sheet
to open links and navigate through those links and scrape information. You may have it open the first 10 rows of links. You may set a delay before it opens a link to handle lazy loading on pages.
You DON’T need a Google Sheet to loop through data so you can Skip
¹ this part if you just want to scape a ton of data. But because the purpose of this tutorial is to import data from our Google Sheet, we click Setup
² and the steps are the following.
Once you press continue, you’ll see this Connect Google Sheet page. Simply paste the link of the spreadsheet
you have your data in and share your sheet with automations@taskmagic.com
Google Sheet
URL. Once you finish the Google setup, you’ll see this page. Here is where we’ll setup from where we want this loop to get the data
² from and how many times we want it to loop
¹ . Lets say our data star in row 2 because row 1 is headers. We would write row 2 in the input
². If we want to loop the automation 10 times, we would write 10 instead of 1 in the input
¹ .
Once you set up your loop, the next page you’ll see is a schedule to run page. If you want to setup a Schedule¹ you can set it up here, if you want to skip this just press continue
².
After completing the trigger configuration, you'll notice the emergence of a Loop bar
¹. This bar empowers you to pinpoint the precise steps where you'd like the loop to take effect. For our current scenario, we're setting the loop's
¹ initiation at step 1 and concluding it at step 4 – that's where our Loop bar
¹ comes into play. Additionally, you'll spot a variable
² within the steps. By clicking the green +
³ symbol, we can seamlessly integrate this variable
² and incorporate a new step. While I've already added this step in our case, if it hasn't been incorporated yet, it's a step you'll want to consider adding.
Upon clicking the vibrant green "+"
icon, you'll be greeted by a dropdown
menu. Within this dropdown, our destination is the URL
¹ option – a choice that holds the key to our next step.
When you opt for the URL option, a popup window will make its appearance. It's at this point that we're primed to input a URL link
¹ or to search for a variable
² or choose the ones handy. Because of the loop trigger we've established, there's a clever shortcut: we can effortlessly cycle through the @links
³, which houses all the URLs we aim to incorporate. Once you’ve selected your variable, you can simply click Save
⁴.
After successfully completing these two maneuvers – fine-tuning the loop bar and configuring the variable – we're all set to hit the Play Steps
¹ button and witness the enchanting magic unfold before our very eyes.
When you see the Complete message
¹, it means that all the information you scraped has been stored in the Google Sheet you selected.
When your automation runs it can increment through each row in google sheet and swap the real value out for the variable so that you can do things dynamically like open link to @Links
¹ where @Links
¹ would be replaced with the row value