Refresh profile data in Canvas before you send
When a journey lasts days or weeks, profile data can change after the user entered the Canvas. Use a Context step to look up the matching object on the profile, then branch messaging with Audience Paths or Decision Split.
About this example
ClaimsJumpr, a fictional insurance brand, starts an action-based Canvas when a policy is 28 days from renewal. Over those 28 days, ClaimsJumpr sends several reminders. A policyholder can change auto-renewal on that policy after they enter, so messages that only use Canvas entry properties can describe the wrong status.
Each user profile stores policies as an array of objects custom attribute (policies). Each object includes a unique policy_id in the triggering event, and an auto_renewal value (opted_in or opted_out). This example adds a Context step before later Message steps so Liquid reads the current object from policies, matching on the policy_id from Canvas context (the entry event).
This pattern:
- Keeps the entry
policy_idin Canvas context. - Uses a Context step and the Liquid
wherefilter to select the matching object frompolicies. - Stores
auto_renewalas a context variable (auto_renewal) with type String. - Routes copy with Audience Paths or Decision Split context variable filters—not with duplicated abort Liquid in this article.
Considerations
- Test the Canvas in a non-production workspace, including profiles where
auto_renewalis missing on an object. policy_idvalues inpoliciesshould be unique sowherereturns one object.- If another Canvas uses a User Update step to write
policiesfrom the same trigger event, the profile may not be updated before the first message. For the first Message step after entry, use the entry context properties. Use this Context step for later steps, after the profile update has had time to apply. - Context variable names use letters, numbers, and underscores only (up to 100 characters). You can define up to 10 variables per Context step.
- The Liquid in this article is an example. Preview user paths and test sends for your attribute names and values.
Setup
This example assumes:
| Asset | Details |
|---|---|
| Entry | Action-based Canvas on a custom event such as policy_renewal_window_started, with event property policy_id |
| Custom attribute | policies — array of objects, each with policy_id and auto_renewal |
| Context variable | auto_renewal — string (opted_in or opted_out) |
Step 1: Place a Context step before later messages
In the Canvas, add a Context step immediately before the Message steps that must reflect the current auto-renewal status. Do not rely on entry properties alone for those later sends.
Step 2: Define the context variable
In the Context step:
- Set Context variable name to
auto_renewal. - Set the data type to String.
- Enter Liquid that selects the matching policy, then outputs
auto_renewal. Do not wrap theassignsource in extra{{ }}tags.
{% assign matched_policies = custom_attribute.${policies} | where: "policy_id", context.${policy_id} %}
{{ matched_policies[0].auto_renewal }}
context.${policy_id} is the entry event property, available as a context variable. where keeps objects whose policy_id matches that value. The Context step stores the first match’s auto_renewal field.
- Select Preview and confirm the value for a test user who has that
policy_idonpolicies.
For name, type, and Liquid limits, see Context and Context variables.
Step 3: Branch on the context variable
After the Context step, split users with an Audience Paths or Decision Split filter on auto_renewal (for example, equals opted_in versus opted_out). Put the matching reminder on each path.

For filter setup and data-type matching, see Context variable filters. For how groups are evaluated, see Audience Paths and Decision Split.
If you abort a send in a Message step instead of branching, the user still moves to the next Canvas step. For details, see Abort messages and How users advance.
Step 4: Preview and test
Use preview user paths and test sends for:
auto_renewalofopted_inandopted_outon the matching object- A
policy_idthat is not onpolicies(empty or blank context value) - An object that omits
auto_renewal
Confirm later reminders match the profile, not only the status from Canvas entry.