使用 AI 生成表达式 generate-expression
此AI支持的功能内置于历程高级表达式编辑器中,可帮助您从纯语言提示生成有效表达式。
在历程 高级表达式编辑器 打开的任何位置,它都可用。 例如,当您在 优化活动 中配置条件和路由时,或者当您配置使用自定义日期的等待活动时,您需要一个dateTimeOnly表达式。
生成表达式 generate
要使用AI生成表达式,请执行以下操作:
-
在历程中打开高级表达式编辑器,例如从分支条件、优化活动或具有自定义日期的 等待 活动打开。
-
在文本字段中,以纯语言描述要生成的表达式。 例如:
- “来自美国且年龄大于18岁的用户”
- “过去30天内购买过的客户”
请参阅本页末尾的示例提示以了解想法。
-
单击 生成 提交提示。
助理开始生成相应的表达式,并在生成过程中显示进度状态消息。
note NOTE 如果助理无法生成有效的表达式(例如,如果提示引用了可用数据源中不存在的字段),则会显示错误消息。 发生这种情况时,请修改您的提示以使用历程配置中可用的字段名称和数据源,然后再次生成。 -
表达式准备就绪后,在面板中查看结果。
-
在申请前单击
图标,以查看您请求的方案的助理输出。 -
单击 应用 将生成的表达式直接插入高级表达式编辑器(与手动粘贴到的位置相同)。
-
使用复制控件来获取建议的表达式文本,并根据需要将其粘贴到其他位置。
-
示例提示 example-prompts
以下列表仅为提示性想法。 它们不显示生成的表达式语法,确切的输出取决于历程中定义的字段和活动。
历程事件和自定义操作 example-prompts-event-action
- 订单价格合计大于100的"事件"
- “过去7天内创建订单的事件”
- “事件类型为商业购买的事件”
- “过去一小时内已创建订单的事件”
- 订单价格合计超过200的"事件和操作响应具有状态代码"
等待活动表达式 example-prompts-datetime
当 等待 活动使用自定义日期时,您可以通过在 高级表达式编辑器 中生成dateTimeOnly表达式来定义配置文件继续的时间。 例如,来自配置文件属性、事件时间戳、区段资格数据或计算的来自当前时间的偏移。 有关如何配置自定义等待和适用的限制,请参阅自定义等待。
- “将客户的上次订单日期仅用作日期时间”
- “使用同意电子邮件时间作为仅日期时间”
- “将区段成员资格的上次资格时间转换为仅日期时间”
- “等待节点:2024年圣诞节后一周作为仅日期时间”
- “等待节点:从现在起的30天下午10:00仅作为日期时间”
- “在UTC时区中等到今天上午9点,仅返回为日期时间”
受众成员资格提示 example-prompts-audience
以简单的语言描述您要创建的受众成员资格检查。 例如:
- “检查配置文件是否在Gold Loyalty受众中”
相关资源 related
- 使用高级表达式编辑器 — 表达式编辑器界面和受支持语法的概述。
- 在Journey Optimizer中生成内容入门 — 生成人工智能功能的常规护栏、访问和设置。
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 use AI in the Journey advanced expression editor to generate valid journey expressions from plain language prompts.
Intents:
- Generate a journey expression from a natural language description using AI
- Apply a generated expression directly into the advanced expression editor with the Apply button
- Use AI-based expression generation inside Optimize activities, Condition activities, and custom-date Wait activities
- Provide example prompts for event-based conditions and
dateTimeOnlywait expressions - Check audience membership using a natural language prompt, such as asking whether a profile is in the Gold Loyalty audience
- Troubleshoot failed generation by revising prompts to reference valid field names and data sources
Glossary:
- Generate expressions with AI: An AI-powered generative capability embedded in the Journey advanced expression editor that converts plain language prompts into valid journey expressions (product-specific)
- Advanced expression editor: The Journey Optimizer interface for writing complex expressions in conditions, Wait activities, and action parameter mapping (product-specific)
- dateTimeOnly: A date-time expression type without timezone, required for custom-date Wait activities (product-specific)
- Optimize activity: A journey activity that supports branching conditions configurable via the advanced expression editor (product-specific)
Guardrails:
- Generative AI guardrails and limitations from the main Generate Content documentation apply to this feature
- If the assistant references fields not present in your journey’s data sources, it returns an error — revise the prompt to use available field names
- The exact generated expression syntax depends on the fields and activities configured in your specific journey
Terminology:
- Canonical name: Generate expressions with AI — Acronym: none — variants: AI expression generation, journey expression generator
- Synonyms: “Generate expressions with AI” = “AI expression generator”
- Do not confuse: Generate expressions with AI (AI-powered generator) ≠ Advanced expression editor (the manual code editor itself)
FAQ:
- Q: Where is Generate expressions with AI available? — It is available wherever the Journey advanced expression editor opens, including Condition activities, Optimize activities, and Wait activities with a custom date.
- Q: What happens if AI cannot generate a valid expression? — An error message appears; you should revise your prompt to use field names and data sources that exist in your journey configuration.
- Q: How do I insert a generated expression into the editor? — Click the Apply button in the assistant panel to insert it directly at the current cursor position in the advanced expression editor.
- Q: Can Generate expressions with AI create
dateTimeOnlyexpressions for Wait activities? — Yes; for example prompting “30 days from now at 10 PM as date time only” generates the appropriatedateTimeOnlyexpression.