Look-Ups

Lookups in applications are used to represent a set of codes and their translated meanings. Let’s have a look at the available lookup tags within ZML:
Resource Look-Ups
Within ZML, resource look-ups allow you to fetch and display catalog/resource data directly in content. Resources can be retrieved using:
A single resource lookup
A multiple resource query
Specific Resource Lookup
To return an individual resource, use the resource ID. Optionally include resource_type for improved performance.
CODE
|
This creates the object {{product}}, which contains the resource data.
Example usage:
CODE
|
Parameters | Description |
|---|---|
id | Specify the resource identifier you’re trying to retrieve. |
resource_type | Specify the type of resource. |
Multiple Resource Query
To retrieve multiple resources without recommendations, use the {% resources %} tag.
CODE
|
Filter fields must exist in the resource schema. User-passed properties are not valid.
Parameters | Description |
|---|---|
count | Specify the number of resources to be returned in your query. |
filter | The one or more resource fields to query against. |
sort_field | The timestamp field to sort the returned array on. No other data type is supported.
CODE
|
sort_order | The order in which the array of resources will be returned. |
Filter Operators (Liquid {% resources %})
Operator | Description | Typical field types/notes |
|---|---|---|
| Exact match: the field must equal one of the supplied values (see pipe below). | TEXT, TAGSET, resource-type, identifiers; also used where the schema treats values as exact. |
| Value must appear as a substring (or overlap match, depending on backend), not necessarily exact equality. | TEXT, string-like props, TAGSET-style lists where “contains” semantics apply. |
| Timestamp on the field is after the reference time described by the value (commonly a relative ISO-8601 duration from “now”). | DATE / TIMESTAMP fields (e.g. |
| Timestamp on the field is before that same kind of reference. | Same as AFTER — date/timestamp fields. |
| Exclude resources that would match the given value(s) for that field (negated condition). | Same families as |
| Filter on whether the field is present or absent (or the documented sentinels), not on a specific content match. | Per product grammar, the value should be |
Operator Rules
{% resources my_product
| count: 3
| filter: 'resource-type', 'CONTAINS', 'product'
| sort_field: 'bt_updated_at'
| sort_order: 'desc'
%}
Operators must be uppercase.
In this example, use 'CONTAINS' instead of 'contains'
If omitted, the operator defaults to
=Variable names should be unique and differentiated from other variables and values within the tag.
In this example, since ‘product’ is used as a value, do not use that as a variable name elsewhere.
v=Variable names should not conflict with property names that may be available on the profile.
Use only schema-defined fields.
Resources | Resources, also known as feeds/catalogs, are product listings of a client’s domain, like e-commerce, arts, banking, and more. This list is synced to ZMP daily. | |
|---|---|---|
Variants | Variants are sub-products or child nodes of the same product. | |
Default Product ![]() | Variant Product: (Blue Highlight) ![]() | |
ZMP will result in only very few products in the resources' graphical UI. So, to identify and analyze all the data available in resources, we are using the following liquid syntax as a solution:
Results in Resources UI ![]() Resource Lookup Syntax
CODE
Resource with Variant Lookup Syntax
CODE
|
Event Look-Ups
Trigger Event Object
For content being sent from a triggered campaign, an event object is available to populate information in the content from the event that triggered the campaign. The properties available in the event are the same properties passed in the payload of the event. Take the following purchased event as an example:
Purchased Event Payload
|
To populate the productname information from the first item in this purchased event, we can use the following event object:
Input
|
Output
|
Event Look-Up Tag
Multiple past events can also be used in content using an event lookup tag.
The following example creates a variable called purchases as an array of the last three purchase events for the given user_id, the message is being created for. The full contents of the array can be viewed in content using {{purchases}} or a for loop to iterate over the array to find the details you need.
Note that ZMP system events are disabled by default from event look-ups. If you need to access a ZMP system event, please reach out to your Zeta account team.
Input
CODE
|
The event_type parameter can be changed to retrieve events of the specified name. The count parameter sets the limit for the number of past events that should be retrieved.
Event Lookup Tag Query Parameters
Parameters | Description |
|---|---|
event_type | The exact name of the account event to look up. |
count | Specify the number of past events to be retrieved. |


