Skip to main content

Using Okendo Quizzes with Shopify Flow

Written by Adarsh Subramaniam
Updated this week

You can utilize Shopify Flow to create automated workflows based off Okendo Quizzes events. This article will detail example workflows which can be set up using these triggers. Ensure that the Shopify Flow app is installed on your store before proceeding.

In this article, you'll learn about:

Okendo Quiz Response Created Details

This event is triggered when a user submits a response to an Okendo quiz. It contains the below variables:

Variable

Description

Customer Display Name

The display name of the customer, which may be 'Anonymous' if Okendo cannot attribute a name to a survey response.

Quiz Name

The name of the quiz.

Date Created

The date and time (ISO 8601 in UTC) at which the survey response was submitted.

Coupon Code

The coupon code that the customer received by responding to the quiz or empty if no coupon was awarded for this quiz response.

Coupon Description

The description of the coupon code that the customer received by responding to the quiz or empty if no coupon was awarded for this quiz response.

Email

The customer's email address.

How to Configure Flows

Follow these steps to set up the Quiz Response Created trigger in Shopify Flow:

  1. Log in to your Shopify Admin.

  2. Navigate to the Shopify Flow app.

  3. Create a new workflow:

    • Click on Create Workflow.

  4. Add the trigger:

    • Search for and select Quiz Response Created.

  5. Set conditions (optional):

    • You can add conditions based on the quiz name if needed.

  6. Add actions:

    • Choose actions such as awarding loyalty points in Okendo with a custom earn rule or receiving notifications via Slack.

  7. Save your workflow.

  8. Test your workflow.

Example Workflows

Award Okendo Loyalty points for a quiz completion

  1. Go to Loyalty → Loyalty Rules.

  2. Click Create Rule and select Custom Action.

    1. Enter a Title (e.g., “Complete Okendo Quiz”).

    2. Enter the Notification Text (Past Tense) (e.g., “Completed Okendo Quiz”).

    3. Set the Points Awarded (e.g., 100 points).

    4. (Optional) Add any Restrictions (e.g., once per customer).

    5. Toggle the rule Active and click Apply/Save.

    6. Open the rule, expand How To Trigger, and copy the Action ID.

  3. Go to Shopify Flow and create a new flow.

  4. Add the trigger Quiz Response Created.

  5. Add the action Trigger Custom Earning Rule (Okendo action).

  6. Paste the copied Action ID into the Action ID field.

  7. In Email Address, map the quiz email (e.g., {{email}}).

  8. Leave Value blank (unless using a points-per-value rule).

  9. Save the flow and switch it from Stopped to Live.

For information about Custom Loyalty Earn rules, please read this article.

Tag or update the metafield of customer

Tag a customer that they have completed a quiz

  1. Go to Shopify Flow and create a new flow.

  2. Add the trigger Quiz Response Created.

  3. Click Add Action.

  4. Select Shopify.

  5. Choose Get customer data.

  6. Set Query type to Advanced.

  7. In the query field, enter:
    email:{{email}}

  8. Set Maximum number of customers to 1.

  9. Set Sort data by to:

    • Created at

    • Ascending

  10. Click Save.

  11. Click Add Action again.

  12. Select Shopify.

  13. Choose Add customer tags.

  14. In the Customer field, map:
    {% for c in getCustomerData %}{{ c.id }}{% endfor %}

  15. In the Tags field, enter the below, example:
    okendo-quiz-completed

  16. Click Save.

  17. Turn the flow from Stopped to Live.

Update the metafield of a customer with their quiz submission date

  1. Go to Shopify Flow and create a new flow.

  2. Add the trigger Quiz Response Created.

  3. Click Add Action.

  4. Select Shopify.

  5. Choose Get customer data.

  6. Set the query type to Advanced.

  7. In the query field, enter:
    email:{{email}}

  8. Set Maximum number of customers to 1.

  9. Set Sort data by to:

    • Created at

    • Ascending

  10. Click Save.

  11. Click Add Action again.

  12. Select Shopify.

  13. Choose Update customer metafield.

  14. In the Customer field, map:
    {% for c in getCustomerData %}{{ c.id }}{% endfor %}

  15. In Metafield, select an existing metafield, for example:
    Okendo Quiz completed date (custom.okendo_quiz_completed_date)

  16. Ensure the Type is Date and time.

  17. In the Value field, enter:
    {{dateCreated}}

  18. Click Save.

  19. Turn the flow from Stopped to Live.

Create a ticket in Gorgias to follow up quiz submissions

  1. Go to Shopify Flow and create a new flow.

  2. Add the trigger Quiz Response Created.

  3. Click Add Action.

  4. Select Gorgias – Live Chat & Helpdesk.

  5. Choose Create a ticket.

  6. In Subject, enter the below, for example:
    Quiz Submission – {{quizName}}

  7. In Customer’s email, map the email variable:
    {{email}}

  8. In Content, enter your internal note, for example:

    This customer has just submitted a quiz.  Their reward details are below:  {{couponCode}} {{couponDescription}}
  9. Click Save.

  10. Switch the flow from Stopped to Live.

Limitations

  • The trigger only activates for quiz responses that include an email address. Responses without an email will not trigger the flow.

  • Response data such as questions & answers as well as recommendations are not currently sent as part of the trigger.

  • Flows with the Okendo Quiz Created trigger will only run every 5 minutes as new events are checked for.

Did this answer your question?