Global Action: Add multiple rows to a Google Sheet

The  Add multiple rows to a Google Sheet Action in Arigato allows merchants to send one or more complete row of data to a Google Sheet.

Configuring the Action

This Action requires the integration be set up and configured first. See the Related Article at the bottom of the page for instructions on configuring the integration in general.

Field Name Description
URL The URL to the Google Sheet where the data will be added.
Tab The specific sheet tab within the Google Sheet to send data to.
Cell Values A textarea for row data. Here you enter the values for each column in your row, separated by new lines. To add multiple rows, use the #NEWROW# token at the end of a row before starting the next.

Example for Cell Values using tokens:

{{ product.title }}
{{ product.vendor }}
{{ product.id }}
#NEWROW#
Another Product's Title
Another Product's Vendor
Another Product's ID

Another example, using some Twig code to loop over line items. This example will insert each line item on a new row. Other unique rows could be added above or below, such as basic order information, followed by the line items. 

{% for line_item in order.line_items %}   
  {{ order.id }}
  {{ order.name }}
  {{ line_item.title }}
  {{ line_item.variant_title }}
  {{ line_item.sku }}
  {{ line_item.quantity }}
  {{ line_item.final_line_price }}#NEWROW#
{% endfor %}

Note that the #NEWROW# indicator was added to the last item in the loop to prevent adding a blank column, since it would otherwise be on a new line.

Troubleshooting & Usage Tips

Preventing Leading Zeros From Being Dropped
Google removes leading zeros when they are inserted into a Sheet, for example 0123 will be added to a Sheet as 123.

To preserve leading zeros, add an apostrophe to the beginning of the value with no spaces. For example, '0123, or when using a token add it before the token, '{{ variable }}

Inserts Are Not Working as Expected
The first cell in the first column must not be blank. The value does not need to be unique, but it must not be blank. Using unique identifiers is a good practice. Using the product or order id for this purpose is recommended.

Inserted Data Looks Encoded
Special characters in text are always escaped by Shopify before sending the data to apps. This data can sometimes be further escaped by the app itself. In most cases, the data can be returned to the original format using the raw filter. For example {{ product.body_html | raw }}.

Updating Existing Cells or Rows
This action does not allow existing cells or rows to be updated. Instead, use the Action Insert or update one row in a Google Sheet.

Reading data from a Google Sheet
Arigato does not currently support reading data. It only supports adding data.

Poor Performance of Inserts
Google's Sheet's API is known to be very slow, especially with large data sets. Slow responses from Google can result in failed inserts as the Google API can hang for minutes without response. Less data per Sheet can help this issue. Consider switching to the Airtable integration if performance becomes an issue.

Inserts Failing with Log Message: Invalid Grant, Bad Request
Refer to the Related Article linked below titled Google Sheets Integration.

Multiple Actions or Apps Sharing a Sheet
Only one app or Action should be inserting or updating data in a Sheet at a time to avoid unexpected results, collisions, etc.

Custom Actions

Using this Action in a Custom Action is supported. See documentation.

Recommended App

Check our other app, Instasheets, for additional functionality.