使用高级表达式编辑器 about-the-advanced-expression-editor

使用历程高级表达式编辑器在界面的各种屏幕中构建高级表达式。 例如,您可以在配置和使用历程时以及在定义数据源条件时生成表达式。

它还可在您每次需要定义需要特定数据操作的操作参数时使用。 您可以利用来自事件的数据或从数据源检索的其他信息。 在历程中,显示的事件字段列表是符合上下文的,并根据历程中添加的事件而有所不同。

高级表达式编辑器提供一组内置函数和运算符,让您处理值并定义一个专门满足您需求的表达式。 高级表达式编辑器还允许您定义外部数据源参数的值、处理映射字段和集合。

NOTE
历程高级表达式编辑器中可用的功能和功能与个性化编辑器中可用的功能和功能不同。

访问高级表达式编辑器 accessing-the-advanced-expression-editor

高级表达式编辑器可用于:

如果可能,您可以使用​高级模式 / 简单模式​按钮在两种模式之间切换。 此处介绍了简单模式。

NOTE
  • 条件可以在简单或高级表达式编辑器中定义。 它们始终返回布尔类型。

  • 操作参数可以通过选择字段或通过高级表达式编辑器来定义。 他们根据表达式返回特定数据类型。

您可以通过不同方式访问高级表达式编辑器:

  • 在创建数据源条件时,单击​ 高级模式 ​可访问高级编辑器。

  • 创建自定义计时器时,系统将直接显示高级编辑器。

  • 映射操作参数时,单击​高级模式

NOTE
若要使用自然语言提示生成历程表达式,请通过高级编辑器中的AI控件使用​**生成带有AI** (public beta)的表达式。

探索界面 discovering-the-interface

此屏幕允许您手动编写表达式。

屏幕左侧显示了可用字段和函数:

  • 事件:选择从入站事件接收的字段之一。 显示的事件字段列表是符合上下文的,并根据历程中添加的事件而有所不同。 了解详情

    note caution
    CAUTION
    不支持使用体验事件创建表达式。 此处引用了使用体验事件创建表达式/逻辑的替代方法和最佳实践
  • 受众:如果您已删除​ 受众资格 ​事件,请选择要在表达式中使用的受众。 了解详情

  • 数据源:从数据源的字段组提供的字段列表中进行选择。 了解详情

  • 历程属性:此部分重新分组与给定用户档案的历程相关的技术字段。 了解详情

  • 函数:从允许执行复杂筛选的内置函数列表中进行选择。 函数按类别组织。 了解详情

自动完成机制会显示上下文建议。

语法验证机制检查代码的完整性。 错误显示在编辑器顶部。

TIP
在高级表达式编辑器中创建条件时,请确保表达式不包含隐藏或不可打印的字符。 此外,使用单行表达式以避免分析错误。

使用高级表达式编辑器构建条件时需要参数

如果您从外部数据源中选择需要调用参数的字段(请参阅此页面),则右侧将显示一个新选项卡,允许您指定此参数。 参数值可能来自位于历程或Experience Platform数据源中的事件(而非其他外部数据源)。 例如,在与天气相关的数据源中,常用的参数将为“city”。 因此,必须选择要获取此城市参数的位置。 还可以将函数应用于参数以执行格式更改或连接。

对于更复杂的用例,如果要在主表达式中包含数据源的参数,可以使用“params”关键字定义其值。 请参阅此页

AI Knowledge Reference

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 introduces the Journey advanced expression editor — its access points, interface panels, and capabilities for building complex conditions, custom wait timers, and action parameter mappings using events, data sources, functions, and operators.

Intents:

  • Access the advanced expression editor from a data source condition, custom wait activity, or action parameter mapping
  • Build advanced boolean conditions using event fields, data source fields, audience membership, and journey properties
  • Switch between simple mode and advanced mode when configuring conditions
  • Reference external data source parameters directly within the main expression using the params keyword
  • Use AI-powered expression generation to create expressions from natural language prompts

Glossary:

  • Advanced expression editor: The Journey Optimizer code editor for writing complex expressions; distinct from the simpler point-and-click condition editor (product-specific)
  • Simple mode: A point-and-click condition editor; less flexible than the advanced editor but easier for non-developers (product-specific)
  • Journey properties: Technical fields about the journey instance (ID, version, errors, current node) accessible in the expression editor (product-specific)
  • Generate expressions with AI: An AI-powered capability (public beta) inside the advanced editor that generates expressions from plain language prompts (product-specific)

Guardrails:

  • Creating expressions using experience events directly is not supported — use alternative approaches such as computed attributes
  • Conditions always return a boolean type regardless of editor mode
  • Expressions must not contain hidden or non-printable characters, and should use single-line format to avoid parsing errors
  • External data source parameter values can only come from journey events or the Experience Platform data source — not from other external data sources
  • The advanced expression editor functions differ from those in the personalization editor

Terminology:

  • Canonical name: Advanced Expression Editor — Acronym: none — variants: advanced editor, expression editor
  • Synonyms: “Advanced mode” = “advanced expression editor”
  • Do not confuse: advanced expression editor (journey conditions/actions) ≠ personalization editor (message content personalization)

FAQ:

  • Q: When must I use the advanced expression editor instead of the simple mode? — Use the advanced editor when you need to query collections, use functions, reference journey properties, or build multi-condition logic that the simple editor cannot express.
  • Q: How do I pass a parameter to an external data source in the expression? — Use the params keyword in the expression syntax, e.g. #{DataSource.fieldGroup.field, params: {paramName: value}}.
  • Q: What does the autocompletion mechanism do? — It displays contextual field and function suggestions as you type, helping you build valid expressions faster.
  • Q: Where is Generate expressions with AI accessed? — Via the AI control inside the advanced expression editor; it is currently in public beta.
  • Q: Do conditions in the advanced editor return a different type than in simple mode? — No; conditions always return a boolean in both modes.
recommendation-more-help
journey-optimizer-help