Skip to main content

How do I extract Rating Grid data using Shopify Flow?

Written by Steve Jones

Rating Grid responses arrive in Shopify Flow as a single pipe-delimited string, with each item and its rating separated by a colon. This article explains how the data is structured and how to use Liquid code within Shopify Flow to split each item-rating pair into its own column or row when pushing data into a Google Sheet.

If you are new to sending Grapevine survey data into Shopify Flow and Google Sheets, please start with our guide on sending survey responses into Shopify Flow before continuing with this article.

Please note:

For the purpose of this article, we will be using the Response completed Grapevine Surveys trigger. This trigger will fire when all questions in the Grapevine Survey have been answered.

How Rating Grid data appears in the Flow trigger

When a survey containing a Rating Grid question is submitted, the answer for that question is delivered as a single string in the following format:

Item 1: Rating|Item 2: Rating|Item 3: Rating

For example, a Rating Grid question asking customers to rate Ease of use, Effectiveness, Quality and Price might produce:

Ease of use: Below Average|Effectiveness: Excellent|Quality: Above Average|Price: Average

The full answer sits within the response.answers array, alongside the question text and question code:

{
"question": "Please rate your level of agreement with the following statements regarding your shopping experience on our website.",
"questioncode": "7c3143a643910",
"answer": "Ease of use: Below Average|Effectiveness: Excellent|Quality: Above Average|Price: Average"
}

If your survey contains multiple Rating Grid questions, each one will appear as a separate entry in the response.answers array with its own pipe-delimited answer string.

Splitting the data with Liquid in Shopify Flow

To push each item-rating pair into its own column in a Google Sheet, you need to split the pipe-delimited string using Liquid code within your Shopify Flow workflow.

The approach uses the Liquid split filter to break the answer string first by the pipe (|) delimiter to separate each item-rating pair, and then by the colon (: ) delimiter to separate the item name from its rating value.

Extracting individual ratings by position

If you know the order of items in your Rating Grid (and you have not enabled the "Randomise row order" setting), you can extract each rating by its position in the string. This is the simplest approach and works well when you want each rating in its own column in your Google Sheet.

Use the following Liquid code in the relevant fields of your Google Sheets "Add row" action:

To get the first item's rating:

{{ response.answers[0].answer | split: "|" | first | split: ": " | last }}

This outputs: Below Average

To get a specific item's rating by index (zero-based), assign the split result to a variable and access it by position:

{% assign pairs = response.answers[0].answer | split: "|" %} {{ pairs[0] | split: ": " | last }}

Replace pairs[0] with pairs[1], pairs[2], pairs[3] etc. to access the second, third and fourth item respectively.

To get the item name (rather than the rating), use first instead of last:

{% assign pairs = response.answers[0].answer | split: "|" %} {{ pairs[0] | split: ": " | first }}

This outputs: Ease of use

Setting up your Google Sheet columns

A practical column layout for a survey containing a Rating Grid question might look like this:

Response Date

Customer Name

Customer Email

Ease of use

Effectiveness

Quality

Price

For each rating column, use the corresponding Liquid code in the Google Sheets "Add row" action field. For example:

  • Ease of use column:
    {% assign pairs = response.answers[0].answer | split: "|" %}{{ pairs[0] | split: ": " | last }}

  • Effectiveness column:
    {% assign pairs = response.answers[0].answer | split: "|" %}{{ pairs[1] | split: ": " | last }}

  • Quality column:
    {% assign pairs = response.answers[0].answer | split: "|" %}{{ pairs[2] | split: ": " | last }}

  • Price column:
    {% assign pairs = response.answers[0].answer | split: "|" %}{{ pairs[3] | split: ": " | last }}

Please Note:

The answers[0] index refers to the first question in your survey. If your Rating Grid is the second question, use answers[1], and so on.

Extracting ratings by item name

If you have enabled the "Randomise row order" setting, the order of items in the answer string may vary between responses. In this case, rather than relying on position, you can search for a specific item by name.

Use a for loop to iterate through each pair and check for the item name:

{% assign pairs = response.answers[0].answer | split: "|" %}
{% for pair in pairs %}
{% assign parts = pair | split: ": " %}
{% if parts[0] == "Quality" %}
{{ parts[1] }}
{% endif %}
{% endfor %}


This will output the rating for "Quality" regardless of where it appears in the answer string.

Handling multiple Rating Grid questions

If your survey contains more than one Rating Grid question, each one will have its own entry in the response.answers array. Simply adjust the array index to target the correct question. For example, if you have two Rating Grid questions and you want to extract data from the second one, use answers[1] instead of answers[0]:

{% assign pairs = response.answers[1].answer | split: "|" %} {{ pairs[0] | split: ": " | last }}


You can also use the questioncode value to identify the correct question if you prefer not to rely on position. The question code is displayed at the bottom of each question's report view in Grapevine.

A complete example

Here is a full example of a Shopify Flow trigger output from a survey containing two Rating Grid questions:

{
"surveyname": "Customer Experience Survey",
"surveycode": "6a3021a65e4aa",
"customername": "Lionel Messi",
"customeremail": "[email protected]",
"responsedate": "2026-07-16T17:30:31+01:00",
"response": {
"answers": [
{
"question": "Please rate your shopping experience.",
"questioncode": "7c4021a894923",
"answer": "Ease of use: Below Average|Effectiveness: Excellent|Quality: Above Average|Price: Average"
},
{
"question": "How many goals will each player bag at the World Cup?",
"questioncode": "9c713408dae17",
"answer": "Mbappé: Forgot his boots|Haaland: Offside all tournament|Vinicius Jr: A couple of scrappy tap-ins|Harry Kane: 3-5 bangers|Messi: Golden Boot winner"
}
]
}
}

To push the first Rating Grid question's data into separate Google Sheet columns, the Liquid code for each column would be:

  • Ease of use:
    {% assign pairs = response.answers[0].answer | split: "|" %}{{ pairs[0] | split: ": " | last }}

  • Effectiveness:
    {% assign pairs = response.answers[0].answer | split: "|" %}{{ pairs[1] | split: ": " | last }}

  • Quality:
    {% assign pairs = response.answers[0].answer | split: "|" %}{{ pairs[2] | split: ": " | last }}

  • Price:
    {% assign pairs = response.answers[0].answer | split: "|" %}{{ pairs[3] | split: ": " | last }}

Need any help?

If you have any questions about the content of this article or any other Grapevine related question, then please do just get in touch.

Did this answer your question?