在此页面上:了解如何使用规则生成器,通过从数据库属性和表达式添加条件、将它们与逻辑运算符组合以及验证结果,为您的编排的营销活动创建定向查询。
为编排的活动构建规则的主要步骤如下:
- 添加条件 - 使用数据库中的属性和高级表达式生成自己的条件,以创建自定义条件来筛选查询。
- 组合条件 - 使用组和逻辑运算符排列画布中的条件。
- 检查并验证规则 - 在保存之前检查规则的生成数据。
添加条件 conditions
要在查询中添加条件,请执行以下步骤:
-
从 生成受众 活动访问规则生成器。
-
单击 添加条件 按钮,创建查询的第一个条件。
您也可以使用预定义过滤器来启动查询。 为此,请单击 选择或保存筛选器 按钮,然后选择选择预定义筛选器。 有关详细信息,请参阅使用预定义过滤器。
-
识别数据库中的属性以用作条件的标准。 通过属性旁边的“i”图标,可获取有关该属性所在表及其数据类型的信息。
note NOTE 通过 编辑表达式 按钮,您可以使用表达式编辑器通过数据库和辅助函数中的字段手动定义表达式。 了解如何编辑表达式 -
单击属性旁边的
按钮,访问此类其他选项:accordion 值的分布 通过值的分布可以标识在数据库中如何使用值。 此变量有助于了解可用值、其计数和百分比。 它还有助于避免在构建查询或创建表达式时出现大小写或拼写不一致等问题。
如果某些属性有大量值,该工具仅显示前二十个值。 在这种情况下,会出现一个 部分加载 通知来表示有此限制。 您可以应用高级过滤器来优化所显示的结果并关注特定值或数据子集。
若要更快地构建条件,请选择一个值,然后单击 选择属性和值 以填充当前条件的属性和值。
您还可以使用显示表达式编辑器图标
图标的图像在剪贴板上复制值,例如将其粘贴到表达式编辑器中。
accordion 添加到收藏夹 通过向收藏夹菜单添加属性,可以快速访问最常使用的属性。 您最多可以收藏 20 个属性。 收藏和最近使用的属性与组织内的每位用户关联,确保在不同设备间也能访问,从而提供跨设备的一致体验。
要访问您收藏的属性,请使用 收藏夹和最近项目 菜单。 首先显示收藏的属性,然后显示最近使用的属性,这样可以轻松找到所需的属性。 要从收藏夹中移除属性,请再次选择星形图标。
-
单击确认,将所选属性添加到您的条件。
-
此时将显示一个属性窗格,您可以在其中配置所需的属性值。
-
从下拉列表中选择要应用的运算符。 可以使用各种运算符。 下拉列表中可用的运算符取决于属性的数据类型。
accordion 可用运算符列表 table 0-row-3 1-row-3 2-row-3 3-row-3 4-row-3 5-row-3 6-row-3 7-row-3 8-row-3 9-row-3 10-row-3 11-row-3 12-row-3 13-row-3 14-row-3 15-row-3 16-row-3 运算符 用途 示例 等于 返回的结果与在第二个“值”列中输入的数据相同。 等于“Jones”的姓氏 (@lastName) 将仅返回姓氏为 Jones 的收件人。 不等于 返回与输入值不相同的所有值。 语言 (@language) 不等于“英语”。 大于 返回大于输入值的值。 大于 50 的年龄 (@age) 将返回所有大于“50”的值,如“51”、“52”。 小于 返回小于输入值的值。 “DaysAgo(100)”之前的创建日期 (@created) 将返回所有在前 100 天内创建的收件人。 大于或等于 返回所有等于或大于输入值的值。 大于或等于“30”的年龄 (@age) 将返回所有 30 岁或以上的收件人。 小于或等于 返回等于或小于输入值的所有值。 小于或等于“60”的年龄 (@age) 将返回所有 60 岁或以下的收件人。 包含在内 返回值包含在指定值中的结果。 这些值必须以逗号分隔。 出生日期 (@birthDate) 在“12/10/1979,12/10/1984”范围内,将返回在这些日期之间出生的收件人。 不在 原理与“包含在内”运算符类似。 在本例中,将根据输入的值排除收件人。 出生日期 (@birthDate) 不包含在“12/10/1979,12/10/1984”内。 将不会返回在此日期范围内出生的收件人。 为空 返回与第二个“值”列中的空值匹配的结果。 手机 (@mobilePhone) 为空,则会返回所有没有手机号码的收件人。 不为空 与“为空”运算符相反。 无需在第二个“值”列中输入数据。 电子邮件 (@email) 不为空。 开头为 返回以输入值开头的结果。 帐户号 (@account) 以“32010”开头。 开头不是 返回不以输入值开头的结果。 帐户号 (@account) 不以“20”开头。 包含 返回至少包含输入值的结果。 包含“mail”的电子邮件域 (@domain) 将返回包含“mail”的所有域名,如“gmail.com”。 不包含 返回不包含输入值的结果。 电子邮件域 (@domain) 不包含“vo”。 包含“vo”的域名(如“voila.fr”)将不会显示在结果中。 类似 与“包含”运算符类似,它允许您在值中插入 % 通配符。 姓氏 (@lastName) 类似于“Jon%s”。 通配符可充当“万能匹配符”,用于查找如“Jones”之类的名称。 不相似 与“包含”运算符类似,它允许您在值中插入 % 通配符。 姓氏 (@lastName) 不类似于“Smi%h”。 不会返回姓氏为“Smith”的收件人。 -
在 值 字段中,定义预期值。 您还可以通过表达式编辑器使用数据库和辅助函数中的字段手动定义表达式。 为此,请单击
图标。 了解如何编辑表达式对于日期类型属性,使用 预设 选项可以获得预定义的值。
accordion 查看示例
关联表(1-1 及 1-N 关联)上的自定义条件 links
自定义条件允许您对当前规则所用表的关联表进行查询。 这包括具有 1-1 基数关联的表,或集合表(1-N 关联)。
1-1链接
对于 1-1 关联,导航到关联的表,选择所需属性并定义预期值。
您还可以直接选择 值 选取器中的表链接并进行确认。 在这种情况下,需要使用专用选取器来选择对所选表可用的值,如下例所示。
此处的查询将标签为“running”的品牌作为目标选择。
-
在 品牌 表中导航并选择 标签 属性。
-
定义属性的预期值。
以下是一个直接选择了表关联的查询示例。 必须从专用选取器中选择此表的可用值。
1-N链接
对于1-N链接,您可以通过两种方式定义条件:
-
选择收藏集本身,如购买。 这会创建一个 存在(例如 条件),您可以在其中添加子条件。
accordion 查询示例 在本例中,查询的目标选择是购买过 Brewmsaster 产品且价格超过 1000 美元的收件人。
-
选择 购买 表并进行确认。
-
单击 添加条件 以定义要应用于选定表的子条件。
-
根据您的需要添加子条件。
-
-
从收藏集中选择属性 — 浏览到收藏集并选择属性,如价格。
Journey Optimizer提供了三个用于定义条件的选项。
-
默认值:对于大多数用例建议使用此选项。 它会自动为集合创建
exists such as条件。 这等效于使用上述方法直接选择集合,并产生相同的结果。 例如,从 Purchases 中选择 Price 属性会创建 Purchases exists,如 条件。 然后,您可以设置运算符和值,例如等于0。 -
聚合:将聚合函数应用于所选的集合属性。 例如,选择 Count 以创建条件,例如Count(Price)等于0。 您可以使用附加条件来优化聚合中包含的记录。
-
高级:使用集合元素的直接连接。 直接评估所选属性,例如价格(购买/@price)。 此选项适用于收集要素的单个条件。
默认情况下已选择 默认 选项。 在需要计数或聚合集合记录时使用聚合,或在需要直接连接到一个集合属性时使用高级。
-
使用运算符组合条件 operators
每次在规则中添加新条件时,都会通过 AND 运算符自动将其关联到现有条件。 这意味着根据两个条件获得的结果将被合并。
要更改条件之间的运算符,请单击该运算符,然后选择所需的运算符。
可用的运算符为:
- AND(交叉):合并与出站过渡中所有筛选组件相匹配的结果。
- OR(并集):包含与出站过渡中至少一个筛选组件相匹配的结果。
- EXCEPT(排除):排除与出站过渡中所有筛选组件匹配的结果。
处理条件 manipulate
在规则生成器画布工具栏中,包含用于轻松处理规则中条件的选项:
根据需要,您可能需要通过将组件分组到同一组并将它们关联在一起来创建中间组件组。
-
要组合两个现有条件,请选择其中一个条件,然后单击
或 按钮,以将其与上方或下方条件组合在一起。 -
要将现有条件与新条件进行组合,请选择该条件,单击
按钮,然后选择添加组。 选择要添加到组的新属性,然后确认。
在下面的示例中,我们创建了一个中间组,以购买过 BrewMaster 或 VanillaVelvet 产品的客户为目标。
检查并验证您的查询
在画布中生成查询后,即可使用 规则属性 窗格检查该查询。 可用的操作包括:
- 查看结果:显示查询产生的数据。
- 代码视图:在 SQL 中显示基于代码的查询版本。
- 计算:更新并显示规则所针对的记录数。
- 选择或保存过滤器:选择要在画布中使用的现有预定义过滤器,或将查询另存为预定义过滤器以供将来重用。 如果过滤器包含参数,请在应用之前提供值。 有关详细信息,请参阅使用预定义过滤器。
规则就绪后,单击 确认 按钮进行保存。
This section contains structured knowledge intended to support interpretation, retrieval, and question answering related to this topic.
For complete understanding, this information should be combined with the documentation on this page. Neither source is intended to stand alone; the page describes the feature, while this section provides additional context that helps disambiguate terminology, intent, applicability, and constraints.
- TL;DR: This page explains how to build rules for Orchestrated campaigns using the rule builder, by adding conditions from database attributes and expressions, combining them with logical operators, and checking and validating the results.
Intents:
- Add a custom condition to a query by selecting an attribute from the database and defining an operator and value.
- Start a query from a predefined filter instead of building a condition from scratch.
- Use the Distribution of values tool to review available attribute values before building a condition.
- Add attributes to a favorites menu for quicker access when building conditions.
- Build conditions on 1-1 linked tables by navigating to the linked table and selecting an attribute, or by selecting the table link directly.
- Build conditions on 1-N (collection) linked tables by selecting the collection itself to create an exists such as condition with sub-conditions, or by selecting an attribute from the collection and choosing the Default, Aggregate, or Advanced option.
- Combine conditions with AND, OR, or EXCEPT operators and group conditions using the canvas toolbar.
- Check the resulting data, view the SQL code, or calculate the number of targeted records before confirming the rule.
Glossary:
- Rule builder: the interface accessed from a Build audience activity used to create targeted queries for Orchestrated campaigns (product-specific)
- Custom condition: a filtering component that lets you filter a query by building a condition with attributes from the database and advanced expressions (product-specific)
- Distribution of values: a tool that shows how values are used within the database, including their counts and percentages, to help avoid issues such as inconsistent capitalization or spelling (product-specific)
- 1-1 link: a table link with one-to-one cardinality, where an attribute from the linked table can be selected directly (product-specific)
- 1-N link (collection table): a table link with one-to-many cardinality, where conditions can target the collection itself or an attribute within it (product-specific)
- Exists such as condition: a condition created when selecting a collection itself (or, with the Default option, an attribute from the collection), which allows sub-conditions to be added (product-specific)
- Default: the recommended option for a collection attribute condition; it automatically creates an exists such as condition for the collection and produces the same result as selecting the collection directly (product-specific)
- Aggregate: an option that applies an aggregate function, such as Count, to the selected collection attribute (product-specific)
- Advanced: an option that uses a direct join to the collection element, evaluating the selected attribute directly, for a single condition on the collection element (product-specific)
- AND (Intersection): an operator that combines results matching all the filtering components in the outbound transitions (product-specific)
- OR (Union): an operator that includes results matching at least one of the filtering components in the outbound transitions (product-specific)
- EXCEPT (Exclusion): an operator that excludes results matching all the filtering components in the outbound transition (product-specific)
- Rule properties pane: the pane used to check a built query, offering View results, Code view, Calculate, and Select or save filter operations (product-specific)
Guardrails:
- For attributes with a large number of values, the Distribution of values tool displays only the first twenty; a Partial load notification appears to indicate this limitation.
- Up to 20 attributes can be added to favorites.
- Each new condition added to a rule is automatically linked to the existing condition by an AND operator.
- Selecting a predefined filter from the Rule properties pane replaces the rule that has been built in the canvas with the selected filter.
Terminology:
- Canonical name: rule builder
FAQ:
- Q: What is a custom condition? — A filtering component that lets you filter a query by building your own condition with attributes from the database and advanced expressions.
- Q: How many attributes can I add to favorites? — Up to 20 attributes.
- Q: What operator links a newly added condition to an existing one? — An AND operator, by default.
- Q: What is the difference between selecting a collection itself and selecting an attribute from the collection with the Default option? — Both create an exists such as condition and produce the same result; the Default option is the recommended choice for most use cases.
- Q: What does the Aggregate option do? — It applies an aggregate function, such as Count, to the selected collection attribute.
- Q: What happens if I select a predefined filter from the Rule properties pane? — It replaces the rule built in the canvas with the selected filter.
Related pages:
- To start a query from a predefined filter, or to save a query as one: Work with predefined filters (orchestrated/predefined-filters.md)
- To manually define an expression using fields from the database and helper functions: Learn how to edit expressions (orchestrated/edit-expressions.md)
Personas:
- marketer: Can build rules for Orchestrated campaigns by adding conditions with database attributes, operators, and values in the rule builder. Can combine conditions using AND, OR, and EXCEPT operators, and check results before confirming. The page states that each new condition is automatically linked to the existing condition by an AND operator. Where: “Combine conditions using operators”.
Onboarding:
- Level: Intermediate
- First minimal step: Access the rule builder from a Build audience activity.
- Success check: You can view the resulting data, view the SQL code, and calculate the number of records targeted by your rule.
- Previous: Starting a query from a predefined filter instead of building a condition from scratch: Work with predefined filters (orchestrated/predefined-filters.md)
- Next: Manually defining an expression using fields from the database and helper functions: Edit expressions (orchestrated/edit-expressions.md)