All Collections
Customer Fields
Connected Apps
How to use Customer Fields with Shopify Flow
How to use Customer Fields with Shopify Flow

Use triggers and actions in Flow to automate tasks

Brett Shelley avatar
Written by Brett Shelley
Updated over a week ago

Overview

With the integration between Customer Fields and Shopify Flow, you can now automate certain parts of your business processes that would otherwise require manual effort or other 3rd-party apps.

For example, you can use Customer Fields’ triggers within Flow to perform actions based on customer or staff activity. You can then trigger various actions such as sending internal email notifications to staff when a pending customer is created, creating tickets in Gorgias when a certain form is submitted, creating companies in Shopify (for use with Shopify's Plus-only B2B features) when a customer is approved, and much more using Shopify's native Flow actions and other Flow-integrated apps.

In this article


Use Customer Fields' triggers to start a workflow

CF Triggers in Flow

We have created three app-specific triggers in Shopify Flow that are based on a form's account options:

  • 'Default' or 'Require email verification' forms

    • Use the 'Customer submitted form' trigger to start a workflow when a customer record in Shopify is created or updated via a Customer Fields form.

  • 'Require account approval' forms

    • Use the 'New pending customer created' trigger to start a workflow when a pending customer is created in Customer Fields. This specific trigger is meant to be used before a customer record is created in Shopify, which doesn't happen unless the customer is approved through the Customer Fields app.

    • Use the 'Customer approved' trigger to a workflow when a pending customer gets approved in the Customer Fields app, and a corresponding customer record is created in Shopify.

Use conditional logic to customize your workflows (optional)

Shopify Flow allows you to add conditions to triggers to perform different actions based on some criteria. Here are some example conditions you can use with Customer Fields:

  • Form ID equals

    • If you have multiple forms, this condition allows you to customize actions based on which form was submitted.

  • Customer email includes

    • You can filter for users with a specific email domain. For example, you could create a condition If customer email includes @heliumdev.com to create a specific action for staff users.

  • Form payload includes

    • This is a powerful condition that gives you access to all of the data collected on your form and allows you to create a condition that checks for a specific value. Say we have a form that asks the user to select if they are registering for a personal or wholesale account, we can use a condition like If form payload includes ”account_type”:”Wholesale” to create an action only for wholesale customers.

Use Customer Fields' actions to automate B2B workflows

CF Actions in Flow

We have created five B2B-specific actions in Shopify flow that are meant to automate processes related to Shopify's native B2B features (requires Shopify Plus).

  • Create company

    • This action will create a new company in Shopify.

  • Assign address to company location

    • This action will assign an address to a company location, using the data from a customer's default address.

  • Assign customer as company contact

    • This action will assign a customer as a contact for a company.

  • Assign role to company contact

    • This action will assign a role to a company contact.

  • Copy customer metafields to company

    • This action will copy all of a customer's metafield values using the customer_fields namespace and apply them to a company. Other namespaces are not supported.

Popular use cases

You can link your workflows to a huge variety of actions, or even multiple actions, through Shopify or other Flow-compatible apps. Here are some ideas of popular actions that you can use:

  • Send an internal email or Slack notification

    • There's functionality for basic staff notifications built right into the Customer Fields app, but you can use this to have even more control and customization options.

  • Add a new row to a Google Sheet

    • Keep track of your customers or a specific piece of custom data in an external database.

  • Grant rewards points in Yotpo or many other rewards apps

    • Automatically start customers off with some reward points when they create an account.

Access metafield data in Flow to create more powerful and customizable actions

❗ In all code examples below, be sure to replace DATA_COLUMN_KEY and VALUE placeholders with the actual data column name or value that you are looking for.

Using a custom metafield value in a Flow condition

  • If you are using one of the Customer Fields Flow triggers, you will have direct access to the form payload which includes all of the values collected on the form. You can create a condition based on a field value using this structure:

    If form payload includes ”DATA_COLUMN_KEY”:”VALUE”
  • If you are using a different Flow trigger that still provides access to the Shopify customer object, you can create a condition by looking directly at the customer metafields. When using this method, you may also want to add an optional second criteria to the condition to ensure that you are looking at the correct data column:

    If customer > metafields > value Equal to VALUE 
    AND
    If customer > metafields > key Equal to DATA_COLUMN_KEY

Using Liquid to access metafields in actions

Using some Liquid code, you can access customer metafields to create internal email notifications that include actual customer data or pass specific metafield values to other Flow-compatible apps.

The Liquid syntax used in Shopify Flow is unique and should not be confused with using Liquid to display metafield data on the storefront or in an email template, if you are trying to do so, check out our guide here.

Here are some common examples of Liquid code that you can use in Flow:

  • When using any Flow trigger that provides access to the Shopify customer object, you can use this Liquid code to access the value for a specific Customer Fields metafield.

    {% for metafields_item in customer.metafields %}
    {% if metafields_item.namespace == "customer_fields"
    and metafields_item.key == "DATA_COLUMN_KEY" %}
    {{metafields_item.value}}
    {% endif %}
    {% endfor %}
  • You can create a link that will take you directly to a specific customer's record in the Customer Fields app. This is especially useful if you want to review form submissions.

    • If you are using the Customer Fields 'New pending customer created' trigger, you can use our built-in variable for Customer details URL

    • If you are using any other trigger that provides access to the customer object, you can create your own URL using this Liquid code:

      https://app.customerfields.com/customers/{{customer.id | remove: "gid://shopify/Customer/" }}

Download our pre-made Flow templates

This template will help you set up email notifications for when a specific account approval form is submitted.

Did this answer your question?