使用高级表达式编辑器 about-the-advanced-expression-editor
使用历程高级表达式编辑器在界面的各种屏幕中构建高级表达式。 例如,您可以在配置和使用历程时以及在定义数据源条件时生成表达式。
它还可在您每次需要定义需要特定数据操作的操作参数时使用。 您可以利用来自事件的数据或从数据源检索的其他信息。 在历程中,显示的事件字段列表是符合上下文的,并根据历程中添加的事件而有所不同。
高级表达式编辑器提供一组内置函数和运算符,让您处理值并定义一个专门满足您需求的表达式。 高级表达式编辑器还允许您定义外部数据源参数的值、处理映射字段和集合。
访问高级表达式编辑器 accessing-the-advanced-expression-editor
高级表达式编辑器可用于:
如果可能,您可以使用高级模式 / 简单模式按钮在两种模式之间切换。 此处介绍了简单模式。
-
条件可以在简单或高级表达式编辑器中定义。 它们始终返回布尔类型。
-
操作参数可以通过选择字段或通过高级表达式编辑器来定义。 他们根据表达式返回特定数据类型。
您可以通过不同方式访问高级表达式编辑器:
-
在创建数据源条件时,单击 高级模式 可访问高级编辑器。
-
创建自定义计时器时,系统将直接显示高级编辑器。
-
映射操作参数时,单击高级模式。
探索界面 discovering-the-interface
此屏幕允许您手动编写表达式。
屏幕左侧显示了可用字段和函数:
自动完成机制会显示上下文建议。
语法验证机制检查代码的完整性。 错误显示在编辑器顶部。
使用高级表达式编辑器构建条件时需要参数
如果您从外部数据源中选择需要调用参数的字段(请参阅此页面),则右侧将显示一个新选项卡,允许您指定此参数。 参数值可能来自位于历程或Experience Platform数据源中的事件(而非其他外部数据源)。 例如,在与天气相关的数据源中,常用的参数将为“city”。 因此,必须选择要获取此城市参数的位置。 还可以将函数应用于参数以执行格式更改或连接。
对于更复杂的用例,如果要在主表达式中包含数据源的参数,可以使用“params”关键字定义其值。 请参阅此页。
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
paramskeyword - 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
paramskeyword 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.