Chapter 11. Connecting to Google applications

An integration can connect to these Google applications: Gmail, Calendar, Sheets. See the following topics for details:

11.1. Registering Fuse Online as a Google client application

In an integration, to be able to connect to Gmail, Google Calendar, or Google Sheets, you must register your Fuse Online environment as a Google client application. During registration, you enable Google APIs and create credentials that Fuse Online uses to access the Google APIs that you have enabled.

With registration in place, you can create multiple connections to Gmail, Google Calendar, and Google Sheets. You can use each connection in multiple integrations. While each connection to a Google application can use the same Google client ID and Google client secret, which you obtain during registration, each connection can access a different Google account, which you choose.

This procedure instructs you to enable the Gmail API, the Google Calendar API, and the Google Sheets API. However, you can enable only the API(s) that you need rather than all three APIs. At a later time, if you need to create connections to the applications whose APIs you did not enable, you can return here and follow the instructions to enable their APIs.

Important

You must create a new Google client application for Fuse Online. The credentials that Google provides for a new client application contain a refresh token that is used for refreshing expired access tokens. This refresh token is available only the first time that the Fuse Online client application uses the credentials. In Fuse Online, connections to Gmail, Google Calendar, and Google Sheets can all use the same Google client ID and Google client secret. If they do, the refresh token is available to all connections to Google applications. When you view connection details in the Fuse Online user interface, do not click the Validate button. Validation is a second use of the credentials and the refresh token is no longer part of the client credentials. You can, however, re-connect to Google applications.

In development environments, be careful if you choose to use the Google client ID and Google client secret that you are using for some other, non-Fuse Online, OAuth client. Fuse Online requires offline access that is requested on the first OAuth exchange. If another OAuth client already entered the OAuth exchange and did not request offline access, then Fuse Online cannot obtain offline access on subsequent OAuth exchanges. If you are unsure whether offline access was requested on the first exchange, create a new Google client application for Fuse Online.

Prerequisites

  • You must be able to sign in to the Google account that you want to use to register Fuse Online as a Google client application.

Procedure

  1. In Fuse Online:

    1. In the left navigation panel, click Settings.
    2. On the Settings page, near the top, to the right of the callback URL, click Copy Callback URL to copy the callback URL for your Fuse Online environment to the clipboard. You will need this URL later in this procedure.
  2. In another browser tab, go to https://console.developers.google.com and do the following:

    1. Check that you are signed into the Google account that you want to use to register Fuse Online as a Google client application. Or, choose a different Google account and sign in to that account.

      The name of the current Google project appears at the top of the Google APIs page.

    2. To use the current project to grant authorization to Fuse Online, continue to the next step. To grant authorization to Fuse Online in another Google project, choose or create that project. If this Google account does not already have a project, you must create one.
    3. Enable Google APIs:

      1. In the upper left corner, click Navigation menu icon and select APIs and Services > Library.
      2. If necessary, scroll down to see the G Suite row of cards.
      3. Click the Google Calendar API card, which displays a page that indicates that the Google Calendar API is enabled.
      4. Scroll down and click the Gmail API card, which displays a page that indicates that the Gmail API is enabled.
      5. In the upper left corner, click Navigation menu icon and select APIs and Services > Library.
      6. If necessary, scroll down to see the G Suite row of cards.
      7. Click the Google Sheets API card, which displays a page that indicates that the Google Sheets API is enabled.
    4. Give your client application a name:

      1. Click MANAGE.
      2. In the page that appears, in the left navigation panel, click Credentials and then on the right, click Credentials in APIs & Services.
      3. Click the OAuth consent screen tab.
      4. In the page that appears, in the Application Name field, enter a name for the Fuse Online client application. For example, enter Fuse Online client application.
      5. Skip the other fields.
      6. Click Save.
    5. Obtain client application credentials as follows:

      1. To the right of Create Credentials, click the down arrow to display a menu and select OAuth client ID.
      2. In the page that appears, select Web application to display more content.
      3. In the Name field, enter a name for the OAuth client ID for your Fuse Online environment. This is different from the name that you entered for the client application itself. For example, enter OAuth client ID for Fuse Online.
      4. Skip Authorized JavaScript origins.
      5. In the Authorized redirect URIs field, paste the callback URL that you copied from your Fuse Online environment at the beginning of this procedure.
      6. Click Create to display the client ID and client secret for your Fuse Online environment.
    6. To the right of the client ID field, click the Copy icon to copy the client ID to your clipboard.
  3. Return to the Fuse Online Settings page and do the following:

    1. Expand the entries for Gmail, Google Calendar, and Google Sheets.
    2. In the Client ID field for each Google application, paste the Google client ID that you just copied.
  4. Return to the Google developers site and to the right of the client secret field, click the Copy icon to copy the client secret to your clipboard.
  5. Return to the Fuse Online Settings page and do the following in the entry for each Google application:

    1. In the Client Secret field, paste the Google client secret that you just copied.
    2. Click Save. You should get a Registration Successful! notification.
    3. Collapse the entry.

Results

For each Google application API that you enabled, you can create a connection to that application.

All connections from Fuse Online to Google applications use the same Google client ID and Google client secret.

Important

The Google client ID and Google client secret contain token refresh information to ensure that integrations that have connections to Google applications continuously work correctly. Consequently, you should not obtain new credentials. If you do, then you would need to recreate each Google connection, replace the old connections with new connections, and re-publish each integration that uses a Google connection.

11.2. Connecting to Gmail

To trigger execution of an integration when a particular Gmail account receives an email, add a Gmail connection to a simple integration as its start connection. In an integration, to send an email from a particular Gmail account, do either of the following:

  • Add a Gmail connection to the middle of a flow.
  • Add a Gmail connection to finish a simple integration.

The general steps for connecting to Gmail in an integration are:

  1. Registering Fuse Online as a Google client application.
  2. Creating a Gmail connection. When you do this you choose the Gmail account that the connection is authorized to access.
  3. If your integration sends an email from a Gmail account, decide how to populate an email to send.
  4. Adding a Gmail connection to an integration flow.
  5. For a Gmail connection that sends an email, optionally mapping integration data to the email fields.

Information and instructions are in the following topics:

11.2.1. Creating a Gmail connection

When you create a Gmail connection, you authorize the connection to access one particular Gmail account. After you create a Gmail connection, you can add it to multiple integrations.

Prerequisites

Procedure

  1. In Fuse Online, in the left panel, click Connections to display any available connections.
  2. Click Create Connection to display the available connectors. A connector is a template that you use to create one or more connections.
  3. Click the Gmail connector.
  4. In the Configure Connection page, click Connect Gmail, which takes you to a Sign in with Gmail page.

    If Connect Gmail does not display, your Fuse Online environment is not registered as a Google client application. See Registering Fuse Online as a Google client application. When you try to create a Gmail connection and your Fuse Online environment is not registered as a Google client application, then Fuse Online displays multiple fields that prompt for authorization information. While you can create a Gmail connection by entering values in these fields, it is not recommended.

  5. In the page that is prompting you to sign in to Gmail, enter the email address of the Google account that you want this connection to access from Fuse Online and click Next.
  6. In response to openshiftapps.com wants to access your Google Account, click Allow to return to Fuse Online.
  7. In the Fuse Online Name field, enter your choice of a name that helps you distinguish this connection from any other connections. For example, enter Gmail Connect 1.
  8. In the Description field, optionally enter any information that is helpful to know about this connection. For example, enter Sample Gmail connection that uses jkim Gmail account credentials.
  9. Click Save to see that the connection you created is now available. If you entered the example name, you would see that Gmail Connect 1 appears as a connection that you can choose to add to an integration.

11.2.2. Alternatives for populating email to send

A Gmail connection that finishes a simple integration or that is in the middle of a flow sends an email from the Gmail account that the connection is authorized to access. There are several ways to populate the content of the email that the connection sends. Before you add a Gmail connection that sends an email, consider how you want to populate that email.

The alternatives for populating an email to send are as follows:

  • Add a data mapper step just before the Gmail connection that sends an email. In this data mapper step, map data fields that are output from previous steps to Gmail connection Send Email action fields. The Send Email action fields are:

    • Email to
    • Email subject
    • Email text
    • Email cc
    • Email bcc

    If you add a data mapper step then you can map one, some, or all Send Email action fields.

  • When you add a Gmail connection to a flow, configure the action by specifying values in the Send Email action fields. You can specify values in one, some, or all fields.
  • Use both a data mapper step and Send Email action configuration to populate the fields. In other words, you can configure the Send Email action by specifying one or more fields and also add a data mapper step that populates other fields.

    A value that you specify directly in a Send Email action field has precedence over a value that is mapped to the Send Email action field. In other words, suppose you populate a Send Email field by specifying a value when you add the connection and configure the action and also by mapping a value to the same field. The value that you specify in the action configuration always overrides the value that was mapped. For example, suppose you specify people@redhat.com in the Email to action field and you also map an email field from a previous step to the Gmail Email to field. The integration always uses people@redhat.com as the email address.

When you add a Gmail connection that sends an email, all action configuration parameters are optional. This is because you might choose to populate an email entirely by mapping integration data to the Send Email action fields. However, the presence of an email address in the Email to field, either by action configuration specification or by mapping, is required. Without an email address to send the message to, Fuse Online generates a runtime error and the integration stops executing.

11.2.3. Triggering an integration when polling returns a Gmail message

To trigger execution of an integration based on email received by a particular Gmail account, add a Gmail connection as the start connection of a simple integration. When the integration is running, the Gmail connection checks this account for emails at intervals that you control. When the connection finds an unread email, it passes the email to the next step in the integration and, by default, marks the email as read.

Prerequisites

  • You created a Gmail connection that is authorized to access the Gmail account that you want to obtain emails from.

Procedure

  1. In the Fuse Online panel on the left, click Integrations.
  2. Click Create Integration.
  3. On the Choose a connection page, click the Gmail connection that you want to use to start the integration.
  4. On the Choose an action page, select the Receive Email action.
  5. To configure the Receive Email action:

    1. In the Delay field, accept the default of 30 seconds or specify how often you want the integration to check for new email.
    2. Leave the Labels field blank to obtain any unread email. To obtain only certain emails, specify a comma-separated list of labels that are used in the Gmail account that the connection is accessing. By default, the integration obtains the unread emails that have those labels.
    3. Select Mark as read to ensure that the connection does not return the same email twice. If Mark as read is not selected, the connection returns emails that are in the account’s in box, whether or not they were previously read. Or, if you specify one or more labels, then the integration return emails that have those labels whether or not they were already read.
    4. In the Max Results field, accept the default of 5 or indicate the maximum number of emails that the connection can return for each poll. If the connection finds more than this number of unread emails, then it returns the most recent Max Results emails.

      When a Gmail connection returns more than one email, the integration processes the emails as a batch. In other words, Fuse Online executes the integration once for the batch.

    5. Click Next to add this Gmail connection as the start connection in the integration. The connection appears as the first step in the integration flow.

11.2.4. Sending an email from a Gmail account

In an integration, you can send an email from a Gmail account either in the middle of a flow or to finish a simple integration. To do this, add a Gmail connection to the middle of a flow or as a simple integration’s finish connection.

Prerequisites

  • You created a Gmail connection.
  • You are familiar with the alternatives for populating an email to send and you have a plan for populating such emails.
  • Fuse Online is prompting you to add to the integration or to choose the finish connection for a simple integration.

Procedure

  1. On the Add to Integration page, click the plus sign where you want to add the connection. Skip this step if Fuse Online is prompting you to choose the finish connection.
  2. Click the Gmail connection that you want to use to send an email.
  3. On the Choose an action page, select Send Email.
  4. On the Configure Send Email page, do one of the following:

    • Leave all fields blank if you plan to add a data mapper step just before this connection and you plan to map integration data to the Send Email fields.
    • Enter information in one or more of the following Send Email fields. Separate multiple email addresses with a comma.

      1. Email To
      2. Email Subject
      3. Email Text
      4. Email cc
      5. Email bcc
    • Leave some fields blank and enter information in some fields.

      If you plan to add a data mapper step just before this Gmail connection, and you want to map integration data to some email fields, leave those fields blank in the action configuration. Enter values in other action fields as needed.

      A value that you specify in a Send Email action configuration field has precedence over a value that is mapped from a previous step.

  5. Click Next to add the connection to the flow.

Result

The connection appears in the integration flow where you added it.

Next step

If you plan to add a data mapper step before this connection, first add any other connections that you plan to add to this flow. Then add the data mapper step.

11.3. Connecting to Google Calendar

To trigger integration execution when a poll returns an update to a Google calendar, add a Google Calendar connection to a simple integration as its start connection. To add an event to a calendar or update an event in a calendar, you can do either of the following:

  • Add a Google Calendar connection to the middle of a flow.
  • Add a Google Calendar connection to finish a simple integration.

Details for connecting to Google Calendar are in the following topics:

11.3.1. Creating a Google Calendar connection

When you create a Google Calendar connection, you authorize the connection to access the Google Calendars that are associated with one particular Google account. After you create a Google Calendar connection, you can add it to multiple integrations.

Prerequisites

  • You registered Fuse Online as a Google client application and enabled the Google Calendar API.
  • The Fuse Online Settings page entry for Google Calendar has values for the client ID and client secret, which you obtained by registering Fuse Online as a Google client application.

Procedure

  1. In Fuse Online, in the left panel, click Connections to display any available connections.
  2. Click Create Connection to display the available connectors. A connector is a template that you use to create one or more connections.
  3. Click the Google Calendar connector.
  4. In the Configure Connection page, click Connect Google Calendar, which takes you to a Google sign-in page.

    If Connect Google Calendar does not display, then your Fuse Online environment is not registered as a Google client application with the Google Calendar API enabled. See Registering Fuse Online as a Google client application. When your environment is not registered with Google, then when you try to create a Google Calendar connection, Fuse Online displays multiple fields that prompt for authorization information. While you can create a Google Calendar connection by entering values in these fields, it is not recommended.

  5. In the Google sign-in page, select the Google account that you want this connection to access from Fuse Online and click Next.
  6. In response to the openshiftapps.com wants to access your Google Account prompt, click Allow to return to Fuse Online.
  7. In the Fuse Online Name field, enter your choice of a name that helps you distinguish this connection from other connections. For example, enter Google Calendar Work Connection.
  8. In the Description field, optionally enter any information that is helpful to know about this connection. For example, enter Sample Google Calendar connection that uses my Google work account.
  9. Click Save to see that the connection you created is now available. If you entered the example name, you would see that Google Calendar Work Connection appears as a connection that you can choose to add to an integration.

11.3.2. Triggering an integration when polling returns an event from a Google Calendar

To trigger execution of an integration upon obtaining events from a Google Calendar that you specify, add a Google Calendar connection to a simple integration as its start connection. When the integration is running, the Google Calendar connection checks the Google Calendar for events at intervals that you control. When the connection finds events that comply with the way that you configured the Google Calendar Get Events action, the connection passes the events to the next step in the integration.

When a Google Calendar connection returns more than one event, Fuse Online executes the integration for each returned event. For example, if the poll returns 5 events then Fuse Online executes the integration five times.

Prerequisites

  • You created a Google Calendar connection.

Procedure

  1. In the Fuse Online panel on the left, click Integrations.
  2. Click Create Integration.
  3. On the Choose a connection page, click the Google Calendar connection that you want to use to start the integration.
  4. On the Choose an action page, select the Get Events action.
  5. To configure the Get Events action:

    1. In the Delay field, accept the default of 30 seconds or specify how often you want the integration to check the calendar.
    2. In the Calendar name field, enter the name of a calendar that is accessible from the Google account that this Google Calendar connection is authorized to access.
    3. In the Max Results field, accept the default of 5 or indicate the maximum number of events that the connection can return for each poll.
    4. Select one of the following to indicate the date that you want the connection to use to start checking for events. The connection checks that date and subsequent dates.

      • Consume from the current date ahead starts on the current date.

        For example, if you select this option, and if Max Results is 5, then the Google Calendar connection starts checking for events on the current date and returns no more than the first five events that it finds. It does not matter whether or not these events have been updated or added since the last poll.

      • Consume from the last event update date on the next poll starts on the date of the most recently updated event that was returned in a previous poll.

        For example, if you select this option, and if Max Results is 5, then the Google Calendar connection returns no more that 5 updated or new events. The connection starts checking for new or updated events on the date of the most recently updated event that was returned in a previous poll.

    5. Optionally, in the Query for events field, specify text to filter the events that the poll can return. The connection returns only events that contain the specified text in at least one event field.

      For example, suppose that you specify Standup meeting in the query field. A poll would return only those events that have Standup meeting in an event field.

  6. Click Next to add this Google Calendar connection as the integration’s start connection.

Result

The connection appears as the first step in the simple integration.

11.3.3. Obtaining a particular event from a Google Calendar

In an integration, you can obtain a particular Google Calendar event in the middle of a flow. Obtaining a particular event is useful, for example, when you want to:

  • Update the event in a subsequent Google Calendar connection.
  • Announce the event by using a subsequent Twitter connection.

To obtain one event, add a Google Calendar connection to the middle of a flow.

Note

In this release, while obtaining a specific event in a simple integration’s finish connection is supported, it is not particularly useful. This is expected to change in a future release.

Prerequisites

  • You created a Google Calendar connection that is authorized to access the Google Calendar that has the event that that you want to get.
  • You are creating or editing a flow and Fuse Online is prompting you to add to the integration.

Procedure

  1. On the Add to Integration page, click the plus sign where you want to add the connection.
  2. Click a Google Calendar connection that is authorized to access the calendar that you want to connect to.
  3. On the Choose an action page, select Get a Specific Event.
  4. Specify the name of the calendar that has the event that you want.
  5. Specify the ID of the event to get. To obtain the event ID, do one of the following:

    • Map it from a previous Google Calendar connection.
    • Manually obtain it from the calendar as follows:

      1. In a browser, display the calendar that contains the event you want to get.
      2. Append ?gsessionid=OK&eventdeb=1 to the URL and redisplay the calendar.
      3. In the calendar, click the event that you want to get.
      4. In the event popup, click Options and select Troubleshooting info.
      5. In the popup that Google Calendar displays, copy the string that follows eid=. For example, an event ID looks something like this: p1pva2a4t504gbsha12di9ch6k_20181107T150000Z*.
  6. Click Next to add the connection to the flow.

Result

The connection appears in the flow where you added it.

Next step

If you want to map any values from a previous step to the fields in this connection, add a data mapper step. First, add all needed connections to the flow. Then add a data mapper step immediately before this connection.

11.3.4. Adding an event to a Google Calendar

In an integration, you can add an event to a Google Calendar in the middle of a flow or to finish a simple integration. To do this, add a Google Calendar connection to the middle of a flow or as a simple integration’s finish connection.

Prerequisites

  • You created a Google Calendar connection that is authorized to access the Google Calendar to which you want to add an event.
  • You are creating or editing a flow and Fuse Online is prompting you to add to the integration. Or, Fuse Online is prompting you to choose a finish connection.

Procedure

  1. On the Add to Integration page, click the plus sign where you want to add the connection. Skip this step if Fuse Online is prompting you to choose the finish connection.
  2. Click a Google Calendar connection that is authorized to access the calendar that you want to add an event to.
  3. On the Choose an action page, select the Create Event action.
  4. Configure the Create Event action:

    1. Enter a title for the new event.
    2. Enter the name of the Google Calendar to add the event to.
    3. For the other input parameters, you can enter data or you might want to map values from an event that you obtained in a previous Google Calendar connection.
  5. Click Next to add the connection to the flow.

Result

The connection appears in the integration flow where you added it.

Next step

If you want to map any values to the fields in this Google Calendar connection, add a data mapper step to the flow. First, add all needed connections to the flow. Then add a data mapper step immediately before this Google Calendar connection.

11.3.5. Updating an event in a Google Calendar

In an integration, you can update an event in a Google Calendar in the middle of a flow or to finish a simple integration. To do this, add a Google Calendar connection to the middle of a flow or as a simple integration’s finish connection.

Important

In this release, the Update Event action requires a value in each event field. In most if not all cases, this means that you must add a Google Calendar connection that obtains the event that you want to update, then add the Google Calendar connection that updates the event, and then insert a data mapper step between the two Google Calendar connections.

Prerequisites

  • You created a Google Calendar connection that is authorized to access the Google Calendar that has the event that you want to update.
  • In the flow, there is an earlier connection to Google Calendar and that connection obtains the event that you want to update.
  • You are creating or editing a flow and Fuse Online is prompting you to add to the integration. Or, Fuse Online is prompting you to choose a finish connection.

Procedure

  1. On the Add to Integration page, click the plus sign where you want to add the connection. Skip this step if Fuse Online is prompting you to choose the finish connection.
  2. Click a Google Calendar connection that is authorized to access the calendar that has the event that you want to update.
  3. On the Choose an action page, select Update Event.
  4. To configure the Update Event action:

    1. Enter the title of the event that you want to update.
    2. Enter content in each event field that you want to update. Do not enter content in an event field when you want the content in that field to remain unchanged.
  5. Click Next to add the connection to the flow. The connection appears in the integration visualization where you added it.
  6. In the integration visualization, click the plus sign that is just before the connection that you just added.
  7. Click Data Mapper.
  8. In the data mapper, for each event field that remains the same in the updated event, map that field from the Google Calendar connection that obtained the event to the corresponding field in the Google Calendar connection that updates the event.

    Do not map fields that you are updating. If you map a field and also specify an update for that field when you configure the Update Event action, Fuse Online uses the mapped value.

  9. In the upper right, click Done to add the data mapper step.

11.4. Connecting to Google Sheets

To trigger execution of an integration when a Google Sheets connection returns spreadsheet data or spreadsheet properties, add a Google Sheets connection to a simple integration as its start connection. To finish a simple integration by updating spreadsheet values or properties, or by inserting a chart or pivot table into a spreadsheet, add a Google Sheets connection to a simple integration as its finish connection.

In the middle of a flow, you can add a Google Sheets connection that obtains, creates or updates values in a spreadsheet, or that inserts a chart or pivot table into a spreadsheet.

Details for connecting to Google Sheets are in the following topics:

11.4.1. Creating a Google Sheets connection

When you create a Google Sheets connection, you authorize the connection to access the Google Sheets spreadsheets that are associated with one particular Google account, which you choose. After you create a Google Sheets connection, you can add it to multiple integrations.

Prerequisites

  • You registered Fuse Online as a Google client application and enabled the Google Sheets API.
  • The Fuse Online Settings page entry for Google Sheets has values for the client ID and client secret, which you obtained by registering Fuse Online as a Google client application.

Procedure

  1. In Fuse Online, in the left panel, click Connections to display any available connections.
  2. Click Create Connection to display the available connectors. A connector is a template that you use to create one or more connections.
  3. Click the Google Sheets connector.
  4. In the Configure Connection page, click Connect Google Sheets, which takes you to a Google sign-in page.

    If Connect Google Sheets does not display, then your Fuse Online environment is not registered as a Google client application with the Google Sheets API enabled. See Registering Fuse Online as a Google client application. When your environment is not registered with Google, then when you try to create a Google Sheets connection, Fuse Online displays multiple fields that prompt for authorization information. While you can create a Google Sheets connection by entering values in these fields, it is not recommended.

  5. In the Google sign-in page, select the Google account that you want this connection to access from Fuse Online and click Next.
  6. In response to the openshiftapps.com wants to access your Google Account prompt, click Allow to return to Fuse Online.
  7. In the Fuse Online Name field, enter your choice of a name that helps you distinguish this connection from other connections. For example, enter Google Sheets Work Connection.
  8. In the Description field, optionally enter any information that is helpful to know about this connection. For example, enter Sample Google Sheets connection that uses my Google work account.
  9. Click Save to see that the connection that you created is now available. If you entered the example name, you would see that Google Sheets Work Connection appears as a connection that you can choose to add to an integration.

11.4.2. Obtaining spreadsheet data to trigger an integration or in the middle of a flow

To trigger execution of an integration upon obtaining data from a Google Sheets spreadsheet, add a Google Sheets connection to a simple integration as its start connection. When the integration is running, the Google Sheets connection polls the spreadsheet at the interval that you specified, obtains the data that you identified, and passes the data to the next step in the integration.

To obtain spreadsheet data in the middle of a flow, add a Google Sheets connection as a middle connection. During execution, Fuse Online polls the spreadsheet for the specified data as soon as it starts processing this connection. In other words, the connection does not wait for an interval to elapse before polling the spreadsheet.

To obtain data from a particular sheet in a spreadsheet, you specify the sheet name when you configure the action for the Google Sheets connection. A particular connection can obtain data from only one sheet.

Between polls, if there are no changes to the sheet values that the connection is configured to return, then the next poll returns the same values as the previous poll.

Prerequisites

  • You created a Google Sheets connection that is authorized to access the spreadsheet that you want to obtain data from.
  • If this Google Sheets connection is triggering integration execution, then you are creating an integration and Fuse Online is prompting you to choose the start connection.
  • If this Google Sheets connection is in the middle of a flow, then the integration already has a start connection and a finish connection, and Fuse Online is prompting you to add to the integration by choosing a step.

Procedure

  1. Click the Google Sheets connection that you want to use.
  2. On the Choose an action page, for a start connection, select the Get sheet values action or for a middle connection, select the Retrieve sheet values action.
  3. To configure the action:

    1. In the SpreadsheetId field, enter the ID of a Google spreadsheet that is accessible from the Google account that this Google Sheets connection is authorized to access.

      To obtain a spreadsheet ID, display the spreadsheet in a browser. The ID is the part of the URL between d/ and /edit.

    2. In the Range field, enter Google A1 notation that identifies the data that you want to obtain. The default is A:A.

      For example, suppose that you want all data from a spreadsheet that has one sheet with 4 columns. Specify A:D. Or, to obtain data from rows 5 through 15, specify A5:D15.

      If the spreadsheet from which you are obtaining data has more than one sheet, specify the sheet name as well as the start cell coordinate and the end cell coordinate. If there is more than one sheet, and you do not specify a sheet name, then the connection obtains data from the first sheet in the spreadsheet. For example, specification of 2019!A1:D5 specifies that you want to obtain data from the sheet whose name is 2019. In that sheet, you want the data that is in columns A through D for rows 1 through 5.

    3. In the Major dimension field, accept Rows, which is the default, or select Columns.

      Rows configures the action to return a collection of row objects where each row object contains a value for each desired column. When Major dimension is Rows, Fuse Online can display meaningful column headings as field names in the data mapper, rather than A, B, C, and so on.

      Columns configures the action to return a collection of column objects where each column object contains a value for each desired row.

    4. In the Header row number field, if Major dimension is set to Rows, optionally enter the number of the row that contains the column headings in the data that the connection obtains. Specification of a header row enables Fuse Online to obtain the headings from the spreadsheet. If you do not specify a header row, column headings default to a letter heading for each column in the range of data that the connection obtains. You can edit obtained headings or letter headings in the subsequent page.

      Note

      If you are configuring a Google Sheets middle connection, the rest of the configuration options are not needed and Fuse Online does not prompt for them. Skip to step 4.

    5. In the Split results field, accept No, which is the default, or select Yes. A setting of No configures the action to return data as a collection of values. That is, the connection passes a collection of row objects or a collection of column objects to the next step in the flow. Select Yes to enable the connection to split the returned data according to the setting of Major dimension. For example, if Major dimension is set to Rows then the connection returns row objects. Each row object triggers a separate execution of the flow. That is, Fuse Online executes the flow once for each returned row object. For example, if the poll returns 5 rows then Fuse Online executes the flow 5 times.

      Fuse Online also provides discrete split and aggregate steps, which you can add to a flow. If you want to process individual objects in one or more steps and then aggregate the row or column objects, do not split the Google Sheets connection result. Instead, accept the default, No, and then add a split step to the flow after this connection. A split step is required if you want an aggregate step in the flow.

    6. In the Delay field, accept the default of 30 seconds or specify how often you want the connection to obtain spreadsheet data.
    7. In the Max results field, accept the default of 0 if you do not want to restrict how many rows or columns polling can return. The setting of Max results applies to the setting of the major dimension in the result matrix. To limit the data that the connection returns for the major dimension, specify an integer.

      For example, suppose that the major dimension is rows and that Max results is set to 25. The poll returns no more than 25 rows of values.

      When Range specifies the major dimension and you also specify Max results, polling uses the lower number to determine how much data to return. Consequently, setting a value for Max results is more helpful when you specify only the minor dimension for Range. For example, consider a sheet that has 30 rows with three columns of values in each row. Suppose that Major dimension is Rows and Range is A:C. If you set Max results to 10, polling returns 10 rows of data. If you accept 0 as the setting of Max results, polling returns 30 rows. However, if you specify Range as A1:C15 and you also specify Max results as 25, polling returns 15 rows. If you specify Range as A1:C30 and you also specify Max results as 25, polling returns 25 rows.

  4. Click Next to view the column names in the data that the connection obtains when Major dimension is set to Rows. If Major dimension is Columns, content in this field is ignored and you can click Next now to complete this procedure.

    The values that appear in the Column names field become the field names that a data mapper step displays. If you specified a header row number, Fuse Online displays the headings from that row in the sheet that you are obtaining data from. If you left the header row number field blank, Fuse Online displays a letter (A, B, C, and so on) for each column in the range of data that you are obtaining.

  5. Optionally, edit the Column names field so it contains the field names that you want to see in a data mapper step. The field must contain a comma-separated list with no spaces, for example, Name,Address,City,State,Zip.
  6. Click Next to add this Google Sheets connection to the flow.

Next steps

If you added a Google Sheets connection as a start connection, Fuse Online prompts you to add the integration’s finish connection. With the start and finish connections in the integration, add any other connections that you want in the integration.

After the connection that obtains sheet values, add a data mapper step. In the data mapper, Fuse Online displays source fields according to how you configure the action that obtains spreadsheet values. That is, if the major dimension is Rows, then the data mapper lists the column names as fields that you can map to the target. If the major dimension is Columns, then the data mapper lists row indexes as fields that you can map to the target.

Additional resource

Google A1 notation for specifying groups of cells in a spreadsheet

11.4.3. Triggering an integration when polling returns spreadsheet properties

To trigger execution of an integration upon obtaining properties from a Google Sheets spreadsheet, add a Google Sheets connection to a simple integration as its start connection. When the integration is running, the Google Sheets connection polls the spreadsheet at the interval that you specified, obtains the spreadsheet properties, and passes the result to the next step in the integration.

Properties include the spreadsheet’s title, locale, and time zone. Between polls, if there are no changes to the sheet properties, then the next poll returns the same values as the previous poll.

Prerequisites

  • You created a Google Sheets connection that is authorized to access the spreadsheet that you want to obtain properties from.

Procedure

  1. In the Fuse Online panel on the left, click Integrations.
  2. Click Create Integration.
  3. On the Choose a connection page, click the Google Sheets connection that you want to use to start the integration.
  4. On the Choose an action page, select the Get spreadsheet properties action.
  5. To configure the Get spreadsheet properties action:

    1. In the SpreadsheetId field, enter the ID of a Google spreadsheet that is accessible from the Google account that this Google Sheets connection is authorized to access.

      To obtain a spreadsheet ID, display the spreadsheet in a browser. The ID is the part of the URL between d/ and /edit.

    2. In the Delay field, accept the default of 30 seconds or specify how often you want the connection to obtain properties.
  6. Click Next to add this Google Sheets connection as the integration’s start connection.

Result

The integration now has a start connection and Fuse Online is prompting you to choose the integration’s finish connection.

11.4.4. Creating a spreadsheet

To create a new spreadsheet in the middle of a flow, add a Google Sheets connection between the start and finish connections. While you can also finish a simple integration with a Google Sheets connection that creates a spreadsheet, you cannot add data to a new spreadsheet in the same connection. Therefore, when you want to create a spreadsheet and add data to the spreadsheet in the same flow, the flow requires two Google Sheets connections. One connection creates the spreadsheet and then a subsequent connection adds data to the spreadsheet.

Prerequisites

  • You created a Google Sheets connection that is authorized to access the Google account in which you want to create the spreadsheet.
  • You are creating or editing a flow and Fuse Online is prompting you to add to the integration. Or, Fuse Online is prompting you to choose a finish connection.

Procedure

  1. On the Add to Integration page, click the plus sign where you want to add the connection. Skip this step if Fuse Online is prompting you to choose the finish connection.
  2. Click a Google Sheets connection that is authorized to access the Google account that you want to use to create the spreadsheet.
  3. On the Choose an action page, select Create spreadsheet.
  4. To configure the Create spreadsheet action:

    1. In the Title field, enter the title of the new spreadsheet.
    2. In the Time Zone field, enter the time zone that the new spreadsheet should use, for example, India Standard Time, or Tokyo.
    3. In the Locale field, enter the locale of the new spreadsheet, for example, Canada, or Hong Kong.
  5. Click Next to add the connection to the flow. The connection appears in the integration visualization where you added it.

Result

A connection that creates a spreadsheet returns the spreadsheet ID for the new spreadsheet. In subsequent steps, you can map this spreadsheet ID to the spreadsheet ID in a connection that accesses the new spreadsheet, for example, to update it.

11.4.5. Updating data in a sheet

In an integration, you can update data in a spreadsheet in the middle of a flow or to finish a simple integration. To do this, add a Google Sheets connection to the middle of a flow or as a simple integration’s finish connection.

Prerequisites

  • You created a Google Sheets connection that is authorized to access the Google spreadsheet that you want to update.
  • You have access to the spreadsheet ID for the spreadsheet that you want to update.
  • You are creating or editing a flow and Fuse Online is prompting you to add to the integration. Or, Fuse Online is prompting you to choose a finish connection.

Procedure

  1. On the Add to Integration page, click the plus sign where you want to add the connection. Skip this step if Fuse Online is prompting you to choose the finish connection.
  2. Click a Google Sheets connection that is authorized to access the spreadsheet that you want to update.
  3. On the Choose an action page, select Update sheet values.
  4. To configure the Update sheet values action:

    1. In the SpreadsheetId field, do one of the following:

      • Enter the ID of the spreadsheet that you want to update.
      • Leave the field blank. In this case, after you add this connection to the flow, you must add a data mapper step before this connection. In the data mapper step, map the spreadsheet ID from a previous connection to this connection. The previous connection must access the spreadsheet that you want to update in this connection.
    2. In the Range field, use Google A1 notation to specify the spreadsheet cells that you want to update. Specify the start and end coordinates, for example, A1:D4 updates the first 4 columns in the first 4 rows in the first sheet in the spreadsheet.

      The default is A:A, which updates the first column in the first sheet in the spreadsheet.

    3. In the Major dimension field, accept Rows, which is the default, or select Columns. Rows configures the action to use row objects to update the sheet. Each row object contains a value for each column that you want to update. Columns configures the action to use column objects to update the sheet. Each column object contains a value for each row that you want to update.
    4. In the Value input option field, indicate how you want Google sheets to interpret the data that it receives for updating the sheet. Unspecified, which is the default, enables Google Sheets to automatically convert data that it recognizes. For example, if the input data is a date, then Google Sheets formats it as a date. If the input data is a decimal, then Google Sheets formats it as a decimal.

      • Unspecified defaults to the Google Sheets API setting, which defaults to User entered.
      • Raw causes Google Sheets to insert the input data as is.
      • User entered enables automatic conversion of recognizable data.
    5. Click Next to add the connection to the flow. The connection appears in the integration visualization in the location where you added it.
  5. If you want to add any other connections to the flow, add them now and then return to these instructions.
  6. After the flow has all desired connections, in the integration visualization, click the plus sign that is just before the Google Sheets connection that updates sheet values.
  7. Click the Data Mapper card to add a data mapping step to the flow.
  8. In the data mapper:

    1. If you did not specify the spreadsheet ID when you configured the Update sheet values action, then map a source spreadsheetId to the target spreadsheetId.
    2. Specify the data that you want to use to update the sheet by mapping fields from a source step to the target spreadsheet. For example, you might map fields from another spreadsheet or from a database.

      If you need to, you can edit the Google Sheets connection that updates sheet values and change the settings for Range or Major dimension. Changing these settings causes the data mapper to display different target fields according to your changes.

    3. In the upper right, click Done to add the data mapper step.

11.4.6. Appending data to a sheet

You can append data to a sheet in the middle of a flow or to finish a simple integration. To do this, add a Google Sheets connection to the middle of a flow or as a simple integration’s finish connection.

Prerequisites

  • You created a Google Sheets connection that is authorized to access the Google spreadsheet in which you want to append data.
  • You have access to the ID for the spreadsheet in which you want to append data.
  • You are creating or editing a flow and Fuse Online is prompting you to add to the integration. Or, Fuse Online is prompting you to choose a finish connection.

Procedure

  1. On the Add to Integration page, click the plus sign where you want to add the connection. Skip this step if Fuse Online is prompting you to choose the finish connection.
  2. Click a Google Sheets connection that is authorized to access the spreadsheet in which you want to append data.
  3. On the Choose an action page, select Append values to a sheet.
  4. To configure the Append values to a sheet action:

    1. In the SpreadsheetId field, do one of the following:

      • Enter the ID of the spreadsheet that you want to append values to.
      • Leave the field blank. In this case, after you add this connection to the flow, you must add a data mapper step before this connection. In the data mapper step, map the spreadsheet ID from a previous connection to this connection. The previous connection must access the spreadsheet that you want to append data to in this connection.
    2. In the Range field, use Google A1 notation to specify the spreadsheet range that you want to append data to. Specify the start and end coordinates, for example, A3:D3 appends data to the first sheet, after the third row for 4 columns. The default is A:A, which appends data to the first column in the first sheet in the spreadsheet.

      The connection never overwrites data. The connection starts appending data after the range you specify, and then always appends data to the content that is in place.

    3. In the Major dimension field, accept Rows, which is the default, or select Columns. Rows configures the action to use row objects to append data. Each row object contains a value for each column that you want to append data to. Columns configures the action to use column objects to append data. Each column object contains a value for each row that you want to append.
    4. In the Value input option field, indicate how you want Google sheets to interpret the data that it receives for appending to a sheet. Unspecified, which is the default, enables Google Sheets to automatically convert data that it recognizes. For example, if the input data is a date, then Google Sheets formats it as a date. If the input data is a decimal, then Google Sheets formats it as a decimal.

      • Unspecified defaults to the Google Sheets API setting, which defaults to User entered.
      • Raw does nothing. Google Sheets inserts the input data as is.
      • User entered enables automatic conversion of recognizable data.
    5. Click Next to add the connection to the flow. The connection appears in the integration visualization where you added it.

      The values that you specify to configure the Append values to a sheet action determine the fields that the data mapper displays for mapping to or from this connection.

  5. If you want to add any other connections to the flow, add them now and then return to these instructions.
  6. After the flow has all desired connections, in the integration visualization, click the plus sign that is just before the Google Sheets connection that appends data to a sheet.
  7. Click Data Mapper to add a data mapping step to the flow.
  8. In the data mapper:

    1. If you did not specify the spreadsheet ID when you configured the Append values to a spreadsheet action, then map a source spreadsheetId to the target spreadsheetId.
    2. Specify the data to append to the sheet by mapping fields from a source step to the target spreadsheet. For example, you might map fields from another spreadsheet or from a database.

      If you need to, you can edit the Google Sheets connection that appends sheet values and change the settings for Range or Major dimension. Changing these settings causes the data mapper to display different target fields according to your changes.

    3. In the upper right, click Done to add the data mapper step.

11.4.7. Updating spreadsheet properties

In an integration, you can update the properties of a spreadsheet in the middle of a flow or to finish a simple integration. To do this, add a Google Sheets connection to the middle of a flow or as a simple integration’s finish connection.

Properties include the spreadsheet’s title, locale, and time zone.

When Fuse Online prompts you to configure the Update spreadsheet properties action, you can leave some or all fields blank. If you leave a field blank, then in a data mapper step that is in the flow (you add it later) before this connection, you map fields from previous steps to blank Update spreadsheet properties action configuration fields.

Prerequisites

  • You created a Google Sheets connection that is authorized to access the Google spreadsheet whose properties you want to update.
  • You have access to the spreadsheet ID for the spreadsheet whose properties you want to update.
  • You are creating or editing a flow and Fuse Online is prompting you to add to the integration. Or, Fuse Online is prompting you to choose a finish connection.

Procedure

  1. On the Add to Integration page, click the plus sign where you want to add the connection. Skip this step if Fuse Online is prompting you to choose the finish connection.
  2. Click a Google Sheets connection that is authorized to access the spreadsheet whose properties you want to update.
  3. On the Choose an action page, select Update spreadsheet properties.
  4. To configure the Update spreadsheet properties action:

    1. In the SpreadsheetId field, do one of the following:

      • Enter the ID of the spreadsheet whose properties you want to update.
      • Leave the field blank. In this case, after you add this connection to the flow, you must add a data mapper step that is before this connection. In the data mapper step, map the spreadsheet ID from a previous connection to this connection. The previous connection must access the spreadsheet that you want to update in this connection.
    2. In the other fields, enter a value only if you want to change the property. Alternatively, you can leave the fields blank. If you do, then in a data mapper step that you add later, just before this connection, you can map the fields that you want to change.
    3. Click Next to add the connection to the flow. The connection appears in the integration visualization where you added it.
  5. If you want to add any other connections to the flow, add them now and then return to these instructions.
  6. After the flow has all desired connections, you might want to use a data mapper step to update spreadsheet properties:

    1. In the integration visualization, click the plus sign that is just before the Google Sheets connection that updates properties.
    2. Click Data Mapper to add a data mapping step to the flow.
    3. In the data mapper, if you did not specify a spreadsheet ID when you configured the Update spreadsheet properties action, map a source spreadsheetId to the target spreadsheetId.
    4. For each spreadsheet property that you want to change and for which you did not specify an updated value when you configured the Update spreadsheet properties action, map a field from a source step to the target spreadsheet property that you want to change.
    5. In the upper right, click Done to add the data mapper step.

11.4.8. Adding a chart to a sheet

In the middle of a flow, or to finish a simple integration, you can add a basic chart or a pie chart to a Google Sheets spreadsheet. To do this, add a Google Sheets connection to the middle of a flow or as a simple integration’s finish connection. Then add a data mapper step just before the connection. In the data mapper step, set options that determine the location, properties, and content of the chart.

When Fuse Online prompts you to configure the Add charts action, you can leave some or all fields blank. If you leave a field blank, you can map a value to that field in the data mapper step that you will add just before this connection.

Prerequisites

  • You created a Google Sheets connection that is authorized to access the Google spreadsheet that you want to add a chart to.
  • You have access to the ID for the spreadsheet that you want to add a chart to.
  • You are creating or editing a flow and Fuse Online is prompting you to add to the integration. Or, Fuse Online is prompting you to choose the finish connection for a simple integration.

Procedure

  1. On the Add to Integration page, click the plus sign where you want to add the connection. Skip this step if Fuse Online is prompting you to choose the finish connection.
  2. Click a Google Sheets connection that is authorized to access the spreadsheet that you want to add a chart to.
  3. On the Choose an action page, select Add charts.
  4. To configure the Add charts action:

    1. In the SpreadsheetId field, do one of the following:

      • Enter the ID of the spreadsheet that you want to add a chart to.
      • Leave the field blank. In the data mapper step that will be just before this connection, map the spreadsheet ID from a previous connection to this connection. The previous connection must access the spreadsheet that you want to add a chart to in this connection.
    2. In the Chart Title field, enter a title.

      Alternatively, leave the field blank. In the data mapper step that is just before this connection, map the chart title from a source field or property to the title target field.

    3. In the Subtitle field, enter a subtitle.

      Alternatively, leave the field blank. In the data mapper step that is just before this connection, map the chart subtitle from a source field or property to the subtitle target field.

  5. Click Next to add the connection to the flow. The connection appears in the integration visualization where you added it.
  6. If you want to add any other connections to the flow, add them now. Then return to these instructions.
  7. In the integration visualization, click the plus sign that is just before the connection that adds a chart.
  8. Click Data Mapper.

    In the data mapper, map source properties, source fields, or source constants to the target Google Sheets connection, which is adding a chart. The following instructions assume that there is a source field, a source property, or a source constant that contains the value that you want to map to each target field.

    If there is no source for the required value, then create a source property in the data mapper by clicking the + sign that is to the right of the Properties folder. In the Create Property dialog, give the property a name that makes it easy to map to the correct target field, for example, specify overlayPosition as the property name. For the property value, specify the value that you want the connection to use to create the chart. The chart’s overlay position field requires A1 notation that identifies a cell. That is, it specifies a start position but an end position specification is not required, and it is ignored if it is present. For example, specify something like D4 as the value of the overlayPosition source property. Save the new property.

    When you configured the Add charts action, you might have specified a value for the spreadsheet ID, the chart title, and/or the chart subtitle. If you did, then do not map a value to that field.

  9. To add a chart to a sheet, map source properties, source fields or source constants to target fields as follows:

    1. Set the location of the chart by mapping an A1 notation value, which identifies a cell, to the overlayPosition target field. An end position is not required and it is ignored if present. The mapped value identifies the cell where Google Sheets places the chart. This cell is the upper left corner of the chart display.

      If you do not map a value to the overlayPosition field, and you also do not map a value to the sheetId field, which identifies the sheet that you want to add the chart to, then the default behavior is that Google Sheets creates a new sheet and places the chart in A1.

      You must map a value to the overlayPosition field if you plan to map a value to the sheetId field.

    2. Map a source spreadsheetId field to the target spreadsheetId field. The connection uses source data in this spreadsheet to add the chart to a sheet in this same spreadsheet. The source data and the chart can be in two different sheets in the same spreadsheet but they cannot be in two different spreadsheets.
    3. Set a chart title by mapping to the target title field. The connection inserts this string as the title of the chart.
    4. Set a chart subtitle by mapping to the target subtitle field. The connection inserts this string as a chart subtitle.
    5. Identify the sheet to add the chart to by mapping an integer to the sheetId field.

      If you map a value to the sheetId field then you must also map a value to the overlayPosition field.

      If you do not map a value to the sheetId field and you also do not map a value to the overlayPosition field, then the connection creates a new sheet and adds the chart to the new sheet.

      If you do not map a value to the sheetId field but you do map a value to the overlayPosition field, then the connection places the chart on the sheet identified by the sourceSheetId field. This is the sheet that provides the data for the chart.

      0 identifies the first sheet in the spreadsheet. For subsequent sheets, the sheet ID is at the end of the URL when the sheet is visible in a browser. For example, at the end of the following URL, you can see gid=206589330:

      https://docs.google.com/spreadsheets/d/1pa…​ngQbKkM/edit#gid=206589330

      This indicates that the sheet ID is 206589330 and that is the value that you would map to sheetId.

    6. Identify the sheet that provides the data for the chart by mapping its integer sheet ID to the target sourceSheetId field. The default is 0, which identifies the first sheet in the spreadsheet.

      You can add a basic chart or a pie chart. Follow one of the following sets of instructions according to the kind of chart that you want to add.

    7. To add basic chart, in the target panel, expand the basicChart folder and map source fields to target fields that are in the basicChart folder:

      1. Set the chart type (BAR, LINE, AREA, or COLUMN) by mapping to the target type field. The default is COLUMN.
      2. Set the title for the bottom axis of the chart by mapping to the target axisTitleBottom field.
      3. Set the title for the left axis of the chart by mapping to the target axisTitleLeft field.
      4. Set the high level category of information that the chart shows by mapping to the target domainRange field. This field uses the Google Sheets A1 notation. For example, suppose that the first column in a source sheet provides a list of 5 products in A2 through A6 , and you want the chart to provide some data for each product. In this column, the first cell (A1) must contain a label, such as Products. The setting of domainRange would be A1:A6. The chart will contain the data that is in A2 through A6. The chart does not display the label.
      5. Identify the location of the source data that the chart shows by mapping to the target dataRange field. This field uses the Google Sheets A1 notation. A chart can provide only one series of data. Continuing with the domainRange example, suppose that the second column in a source sheet shows the number sold for each of the 5 products that are listed in the first column and this is the data that you want the chart to show. In this column, the first cell (B1) must contain a label, such as Number Sold. The setting of dataRange would be B1:B6. The chart will contain the data that is in B2 through B6. The chart does not display the label.
    8. To add a pie chart, in the target panel, expand the pieChart folder and map source fields to target fields that are in the pieChart folder:

      1. Set the location of the pie chart legend by mapping to the target legendPosition field. The default is LEFT_LEGEND. The value must be BOTTOM_LEGEND, LEFT_LEGEND, RIGHT_LEGEND, TOP_LEGEND, or NO_LEGEND.
      2. Set the high level category of information that the pie chart shows by mapping to the target domainRange field. This field uses the Google Sheets A1 notation. For example, suppose that the first column in a source sheet provides a list of 5 products in A2 through A6 , and you want the chart to provide some data for each product. In this column, the first cell (A1) must contain a label, such as Products. The setting of domainRange would be A1:A6. The chart will contain the data that is in A2 through A6. The chart does not display the label.
      3. Identify the location of the source data that the chart shows by mapping to the target dataRange field. This field uses the Google Sheets A1 notation. A chart can provide only one series of data. Continuing with the domainRange example, suppose that the second column in a source sheet shows the number sold for each of the 5 products that are listed in the first column and this is the data that you want the chart to show. In this column, the first cell (B1) must contain a label, such as Number Sold. The setting of dataRange would be B1:B6. The chart will contain the data that is in B2 through B6. The chart does not display the label.
    9. In the upper right, click Done to add the data mapper step.

11.4.9. Adding a pivot table to a sheet

In the middle of a flow, or to finish a simple integration, you can add a pivot table to a Google Sheets spreadsheet. A pivot table lets you aggregate, sort, or apply a function to spreadsheet data and display the results in the same spreadsheet. To add a pivot table, add a Google Sheets connection to the middle of a flow or as a simple integration’s finish connection. Then add a data mapping step before the connection. In the data mapping step, you set options that determine the location, properties, and content of the pivot table.

In this release, the Add pivot table action is limited to defining one value group, one row pivot group, and one column pivot group. Support for multiple groups in a single action is expected to be added in a future release. As a workaround, you can add multiple Google Sheets connections that add pivot tables based on the same source spreadsheet.

Prerequisites

  • You created a Google Sheets connection that is authorized to access the Google spreadsheet that you want to add a pivot table to.
  • You have access to the ID for the spreadsheet that contains the source data for the pivot table.
  • You are creating or editing a flow and Fuse Online is prompting you to add to the integration. Or, Fuse Online is prompting you to choose the finish connection for a simple integration.

Procedure

  1. On the Add to Integration page, click the plus sign where you want to add the connection. Skip this step if Fuse Online is prompting you to choose the finish connection.
  2. Click a Google Sheets connection that is authorized to access the spreadsheet that you want to add the pivot table to.
  3. On the Choose an action page, select Add pivot tables.
  4. To configure the Add pivot tables action, in the SpreadsheetId field, do one of the following:

    • Enter the ID of the spreadsheet that you want to add a pivot table to.
    • Leave the field blank. In the data mapper step that you will add just before this connection, you will map the spreadsheet ID from a previous connection to this connection. The previous connection must access the spreadsheet that you want to add a pivot table to in this connection.
  5. Click Next to add the connection to the flow. The connection appears in the integration visualization where you added it.
  6. If you want to add any other connections to this flow, add them now. Then return to these instructions.
  7. In the integration visualization, click the plus sign that is just before the connection that adds a pivot table to a sheet.
  8. Click Data Mapper.

    In the data mapper, map source properties, source fields, or source constants to the target Google Sheets connection, which is adding a pivot table. The following instructions assume that there is a source field, source property, or source constant that contains the value that you want to map to each target field.

    If there is no source for the required value, then create a source property in the data mapper by clicking the + sign that is to the right of the Properties folder. In the Create Property dialog, give the property a name that makes it easy to map to the correct target field, for example, specify valueLayout as the property name. Specify the value that you want the connection to use to create the pivot table. The pivot table’s value layout field requires a value of HORIZONTAL or VERTICAL so you might specify VERTICAL as the value of the valueLayout property. Save the new property.

  9. In the data mapper, configure a new pivot table as follows:

    1. Map a source spreadsheetId field to the target spreadsheetId field. The connection uses source data in this spreadsheet to add the pivot table to a sheet in this same spreadsheet. The source data and the pivot table can be in two different sheets in the same spreadsheet but they cannot be in two different spreadsheets.
    2. Identify the sheet to add the pivot table to by mapping an integer to the sheetId field. The default is 0, which identifies the first sheet in the spreadsheet. For subsequent sheets, the sheet ID is at the end of the URL when the sheet is visible in a browser. For example, at the end of the following URL, you can gid=206589330:

      https://docs.google.com/spreadsheets/d/1pa…​ngQbKkM/edit#gid=206589330.

      This indicates that the sheet ID is 206589330 and that is the value that you would map to sheetId.

    3. Identify the sheet that provides the data for generating the pivot table by mapping its integer sheet ID to the target sourceSheetId field. If you do not map a value to sourceSheetId, the connection uses the sheetId value, or 0 if no value is mapped to sheetId. 0 identifies the first sheet in the spreadsheet.
    4. Set the source data range for generating the pivot table by mapping an A1 notation value to the target sourceRange field. For example, A2:D5.
    5. Set the value layout to be used on the pivot table by mapping to the target valueLayout field. The value must be VERTICAL or HORIZONTAL, which is the default. HORIZONTAL specifies that values are laid out as columns.
    6. Set the top left cell of the pivot table by mapping an A1 notation cell coordinate to the target start field. When the connection adds the pivot table to the sheet that contains the source data, if you do not map a value to the start field, the default is that the top left cell of the pivot table is the cell that is in the first row of the source data range and in the first empty column after the source data range. When the source data is in one sheet and the pivot table will be in another sheet, the default is A1.
    7. To add a value group, expand valueGroups in the target panel, and map values to the fields under valueGroups:

      1. Map a value group name to the target name field.
      2. Map a function, which you want to apply to the value group, to the target function field. The value must be SUM, COUNT, AVERAGE, MAX, MIN, or CUSTOM. The default is SUM. Map CUSTOM to function when you are defining a formula.
      3. Map a custom formula, which you want to apply to the value group, to the target formula field if you mapped the CUSTOM value to the function field.
      4. Map a column name, which is the coordinate that builds the value group, to the target sourceColumn field.
    8. To add a row pivot group, expand columnGroups in the target panel, and map values to the fields under columnGroups:

      1. Map a row pivot group name to the target label field.
      2. Map the sort order that you want to apply to the row pivot group to the target sortOrder field. The value must be ASCENDING or DESCENDING. The default is ASCENDING.
      3. Map true or false to the target showTotals field. The default is true, which enables the display of totals for the row pivot group.
      4. Map a column name, which is the coordinate that builds the row pivot group, to the target sourceColumn field.
    9. To add a column pivot group, expand rowGroups in the target panel, and map values to the fields under rowGroups:

      1. Map a column pivot group name to the target label field.
      2. Map the sort order that you want to apply to the column pivot group to the target sortOrder field. The value must be ASCENDING or DESCENDING. The default is ASCENDING.
      3. Map true or false to the target showTotals field. The default is true, which enables the display of totals for the column pivot group.
      4. Map a column name, which is the coordinate that builds the column pivot group, to the target sourceColumn field.
    10. In the upper right, click Done to add the data mapper step.