Skip to main content

Save a survey answer to a customer metafield with Shopify Flow

Use Shopify Flow to save the answer to a Grapevine Surveys question into a customer metafield

Written by Stuart Jones

Use Shopify Flow to save the answer to a Grapevine Surveys question into a customer metafield. This works with text, date and number answers, as long as the metafield type matches the question type. The answer then stays on the customer's record, ready to use in customer segments and anywhere else customer metafields are supported.

Please note:
This only works when a survey response can be linked to a customer or order. Standalone and embedded surveys only capture customer details when URL parameters are included in the survey link.

Before you start

  • A Grapevine Surveys paid plan and the Shopify Flow app.

  • A survey question and an existing customer metafield with a matching type (see the next section).

  • The question code for that question, shown at the bottom of its report view.

Match your metafield type to your question

Question type

Metafield type

Open Text

Single or Multi-line text

Single Choice

Single line text

Date

Date

NPS

Integer

CSAT (text, icons, stars)

Single line text

Important:
If the types don't match, Shopify may not be able to save the answer and the metafield won't update.

The workflow you'll be building

Here is how the final workflow will look:

Build the workflow

Create a workflow and select the Grapevine Surveys Question answered trigger:

Add a Condition: questioncode is Equal to your question code:

Add a Get customer data action to the condition's (true) path:
​


Set it to sort by ID, Descending, maximum 1 customer, with an Advanced query of:

id:{{customerid}}

Add a For each action:

Select Get customer data as the variable:

Connect an Update customer metafield action to the Repeat for each item path:

Select your metafield and set the Value to:

{{answer}}

Optionally, add a Log output action to check what the workflow receives. See Sending survey data into Shopify Flow for the full list of variables.


Name your workflow and click Turn on workflow.

Test it

Place a test order using a customer account you own, answer the question, then check the customer's page in your Shopify admin.

Please note:
Our Flow triggers run 5 minutes after a question is answered, to make sure all the response details are captured. Allow at least 5 minutes before checking the customer's page.

Troubleshooting

  • The workflow stopped at the condition. Check the question code matches exactly.

  • The metafield wasn't updated. Check the action is on the Repeat for each item path, that the respondent was identifiable, and that the metafield type matches the question type.

Need any help?

If you have any questions about this article, or need a hand setting up your workflow, just get in touch. We may need to request access to your store to help with the set-up.

Did this answer your question?