使用進階運算式編輯器 about-the-advanced-expression-editor
使用Journey進階運算式編輯器,在介面的各種畫面中建置進階運算式。 例如,您可以在設定和使用歷程時以及定義資料來源條件時建置運算式。
此外,您每次必須定義需要特定資料處理的動作參數時,都可以使用它。 您可以善用來自事件的資料或是從資料來源擷取的其他資訊。 在歷程中,顯示的事件欄位清單會與情境相關,而且會根據歷程中新增的事件而有所不同。
進階運算式編輯器提供一組內建函式和運算子,讓您得以控制值並定義特別符合您需求的運算式。 進階運算式編輯器也可讓您定義外部資料來源引數的值、控制對應欄位和集合。
存取進階運算式編輯器 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.