Tutorials

How to Use the Google Sheets Perform a Function Module

What this scenario does: The Integromat function allows you to perform the function in Integromat and return the result back to the sheet. When you enter an amount in the sheet containing the Integromat function, it triggers the scenario, sends a Slack message with the amount and returns the date/time of the message to the sheet.

Level of difficulty: Intermediate

Implementation Time: Approximately 15 mins

Assumptions: You have read our tutorial on How to Use The Google Sheets Watch Changes Module which is a prerequisite to understanding how to set up a Webhook in a scenario. You have a Google and Slack account with the connections added and a sheet with the relevant columns.

Similar to the built-in functions on Google Sheets (Average, Sum), Integromat has its own custom function called Integromat which can also be used on the sheet. Here we will demonstrate exactly how this function works. Let’s begin.

Configuring the scenario

The scenario consists of the following modules:

  • Google Sheets > Perform a Function
  • Slack > Create a message
  • Google Sheets > Perform a function — Responder

Here’s the scenario:

 

Copy the Webhook URL from the Google Sheets > Perform a Function module and paste it in the Webhook URL field under Perform a function in the Google Sheet:

 

In the Google Sheet, you manually add an amount in column A and the Slack Message Delivery Date/Time returns from the scenario execution to column B. You need to use the function: IFERROR(INTEGROMAT(A2). If you don’t add the IFERROR part here, the function works however the word ERROR displays in the empty cells. Here is a look at the Google Sheet:

 

The Google Sheets > Perform a Function Webhook only requires the Webhook to be added to the sheet to be fully set up so let’s take a look at the Slack module. You need to select the channel and add the text message. Map the Parameters collection: Parameter 1 element from the Google Sheets > Perform a function module in the text which provides the dollar amount:

 

Now let’s take a look at the configuration of the Google Sheets > Perform a Function Responder module. This module works in conjunction with the Perform a Function module. The goal of this module is to send the Slack message delivery date and time back to the sheet. Under Response type, select Text.

In the Value field, use the formatDate function from the Date and Time tab together with the Now variable. This retrieves the current date and time and converts it to this format: MM-DD-YY H:mm:

All done! Let’s take a look at the scenario execution.

Scenario execution

The dollar amounts are entered in column A and the Date/Time data are returned to column B as intended:

 

It’s that easy! Now you know exactly how to use the Google Sheets > Perform a Function module. Start using it in your scenarios today!

Happy Automating! 🙌