使用進階運算式編輯器 about-the-advanced-expression-editor

使用Journey進階運算式編輯器,在介面的各種畫面中建置進階運算式。 例如,您可以在設定和使用歷程時以及定義資料來源條件時建置運算式。

此外,您每次必須定義需要特定資料處理的動作參數時,都可以使用它。 您可以善用來自事件的資料或是從資料來源擷取的其他資訊。 在歷程中,顯示的事件欄位清單會與情境相關,而且會根據歷程中新增的事件而有所不同。

進階運算式編輯器提供一組內建函式和運算子,讓您得以控制值並定義特別符合您需求的運算式。 進階運算式編輯器也可讓您定義外部資料來源引數的值、控制對應欄位和集合。

NOTE
歷程進階運算式編輯器中可用的功能和功能,與個人化編輯器中可用的功能和功能不同。

存取進階運算式編輯器 accessing-the-advanced-expression-editor

進階運算式編輯器可用於:

可能的話,您可以使用​進階模式 / 簡單模式​按鈕,在兩個模式之間切換。 此處會說明簡單模式。

NOTE
  • 可在簡單或進階運算式編輯器中定義條件。 它們一律會傳回布林值類型。

  • 藉由選取欄位或透過進階運算式編輯器,以定義動作參數。 他們會根據其運算式傳回特定資料類型。

您可以透過不同方式存取進階運算式編輯器:

  • 當您建立資料來源條件時,可以按一下​ 進階模式 ​來存取進階編輯器。

  • 建立自訂計時器時,會直接顯示進階編輯器。

  • 當您對應動作引數時,請按一下​進階模式

NOTE
若要使用自然語言提示來產生Journey運算式,請透過進階編輯器內的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