Skip to main content

Fusing Google Sheets Automation

· 7 min read
Peter Beresford

In this article, we will walk through the steps required to use the Fusing workflow automation platform to update rows in a Google Sheet. We will explore some of the key features and benefits of this integration, as well as some use cases where this functionality could be particularly useful.

google sheets logo

Fusing.com is a web-based automation tool that allows users to connect different applications and automate tasks. One of the many ways that users can leverage Fusing's capabilities is by using it to update rows in a Google Sheet. Google Sheets is a popular cloud-based spreadsheet application that allows users to store, organize, and analyze data. By integrating Fusing with Google Sheets, users can automatically update rows in a Google Sheet whenever a trigger event occurs.

Getting Started with Fusing

Before we can begin using Fusing to update rows in a Google Sheet, we first need to create an account on the Fusing platform. Once you have created an account, you will be able to access the Fusing workspace dashboard, which is where you can create and manage your workflows.

A workflow in Fusing is referred to as a "Flow" and it consists of two parts: triggers/events and operations. The trigger/event is the event that initiates the workflow, while the operations are the tasks that are performed as a result of the trigger. In the case of updating rows in a Google Sheet, the trigger might be a new entry in a web form, or a new temperature reading from an IOT device, whereas the operations might include updating a row in a Google Sheet.

Creating a Flow

To create a new Flow, navigate to the Fusing workspace dashboard and click on the "New Flow" button. This will open the Workflow creation wizard, which will guide you through the process of creating your first Flow.

Step 1: Choose a Trigger/Emitter

The first step in creating a Flow is to choose a trigger/emitter. In our case, we want to update rows in a Google Sheet every hour based on the current temperature at our location. To do this, we'll select the Timer Emitter, and then set it to fire on an interval of every 1 hour. There are many other emitters that can be used as triggers in Fusing, including webhooks, and popular web form tools like Typeform and Google Forms.

Fusing Timer Block

Step 2: Retrieve the Current Temperature

Now that we've selected our emitter, it's time to retrieve the temperature from our local weather forecast. To accomplish this, we'll use one of Fusing's Any-Code blocks to query the national weather service for our current temperature. We've elected to use the Fusing NodeJS Javacript block to write our code to fetch the data that we need:

Fusing Node JS Block

Note that we've named the NodeJS block "NodeJS" - this will matter when we are making reference to values that this block retrieves from the weather service. We'll use the following code to retrieve the data that we need:

import axios from "axios";
import Converter from "node-temperature-converter";

const location = {
latitude: 39.7392,
longitude: -104.9903,
name: "Denver",
}

export default await defineBlock({
async run({$}) {
const { latitude, longitude, name } = location;
let response = await axios.get(`https://api.weather.gov/points/${latitude},${longitude}`);
const { forecastHourly } = response.data.properties;
let fahrenheit = 100;
try {
response = await axios.get(forecastHourly);
fahrenheit = response.data.properties.periods[0].temperature;
}
catch (e) {}
const celsius = new Converter.Fahrenheit(fahrenheit).toCelsius().toFixed(1);
return {
counter,
fahrenheit,
celsius,
name,
};
}
})

Step 3: Update our Google Sheet

Once we have our data, we need to choose an operation that will perform the task of updating the row in the Google Sheet. To do this, we need to search for the Google Sheets Add Rows operation in the Fusing directory and select it as our operation.

After we have select the Google Sheets operation, we need to authenticate our Google account and select the Google Sheet that we want to update. We also need to specify which row in the sheet we want to update and which columns we want to update with the data from the temperature.

Fusing Google Sheets Block

When configuring the Fusing Google Sheets block, we've entered the following value into the Row Values field, using the Fusing interpolation syntax to retrieve values from the previous Node JS block:

(`[["${(new Date()).toISOString()}", "${($.block.NodeJS.$returns.name)}", ${($.block.NodeJS.$returns.fahrenheit)}, ${($.block.NodeJS.$returns.celsius)}]]`)

Note that we're adding 4 values to each row, namely:

  • The current date and time
  • The name of the location
  • The current temperature in Fahrenheit
  • The current temperature in Celsius

Step 4: Test and Deploy your new Workflow

Once we have selected our emitter and operations blocks and configured the relevant settings, we need to test the Flow to make sure that it is working correctly. To do this, we can simply run the workflow from beginning to end, and fix any errors that appear. We want to make sure that the correct Google Sheet is updated with the data that we're expecting.

If the test is successful, we can then Deploy the Flow and start using it to update rows in the Google Sheet every hour.

Conclusion

In this article we've used the Fusing workflow automation platform to create a workflow that gathers the current temperature for a location every hour, placing the results into a Google Sheet.