matelso logo 2022 brand
matelso logo 2022 brand
View Categories

How do I link a Google Sheet for reporting?

1 min read

The matelso platform allows relevant data and information to be sent to any third-party systems via the Data Distributor—including Google Sheets.
To automatically save data in a Google Sheet, a simple web app is required that receives incoming JSON data and writes it to a table.

Detailed instructions for using Data Distributor can be found here.

This article shows you step by step how to:

– Prepare a Google Sheet
– Create a Google Apps Script
– Publish the script as a web app
– Use the final URL in Data Distributor.

You will find complete step-by-step instructions below. A video is also available:

1. Prepare Google Sheet

First, create a new Google Sheet and set up the desired columns — in this example:

– Time
– Caller number
– Caller name
– Call duration

 

2. Open the Apps Script Editor

Now open the menu: “Extensions” → “Apps Script”

The Apps Script Editor will automatically open in a new tab.

 

3. Create a new script

By default, a new project contains the file Code.gs.

You can use this file directly.

 

Replace the existing sample code with the following script:

function doPost(e) {
  // JSON-Daten aus dem Request holen
  var data = JSON.parse(e.postData.contents);
  // Spreadsheet und erste Tabelle öffnen
  var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  // Zeitpunkt erzeugen
  var now = Utilities.formatDate(new Date(), Session.getScriptTimeZone(), "dd.MM.yyyy HH:mm");
  // Neue Zeile einfĂĽgen
  sheet.appendRow([
    now,               // Zeitpunkt
    data.number,       // Anrufernummer
    data.name,         // Anrufername
    data.duration      // Gesprächsdauer
  ]);
  // Antwort an den Sender
  return ContentService.createTextOutput("OK");
}

Assign a project name and save the project.

 

4. Publish script as web app

Click on the top right: “Deploy” → “New deployment”

 

Select the “Web app” type in the left pane.

Fill in the fields as follows:

– Description: e.g., Simple call reporting with the matelso platform
– Run as: Myself
– Access rights: Only myself (can be adjusted later)

 

5. Grant access for the web app

In the next step, you will be asked to grant access via your Google account. Click on the button and follow the instructions.

 

6. Copy the deployment URL

After successful deployment, you will receive the web app URL.

This URL is the endpoint that you will use later in Data Distributor.

 

7. (Optional): Change access permissions

If you want the web app to be accessible to external systems (e.g., matelso platform), change the settings in “Manage deployments” → “Access permissions” to:

– Everyone

or

– Anyone with a Google account

 

8. Use the provisioning URL in the Data Distributor

The web app is now ready to receive JSON data.
In the matelso platform, you can enter this URL in a Data Distributor → HTTP Push → POST configuration.