関数 functions

関数は、Adobe Journey Optimizer の動的なジャーニー式の構成要素です。 リアルタイムでデータを変換、計算、検証、操作し、パーソナライズされたカスタマーエクスペリエンスを作成できます。 直感的なカテゴリに整理された 60 を超える関数を使用することで、高度な条件を作成し、複雑な計算を実行し、カスタマージャーニーのすべてのステップでデータ駆動型の意思決定を行うことができます。

関数について

ジャーニー式の関数は、次の一貫性のある構文パターンに従います。

<function name>(<expression as param 1>, <expression as param 2>, … ,<expression as param N>)

主な特性:

  • 複数のシグネチャ:関数は、様々なユースケースに対応するために、異なるシグネチャ(順序付きパラメーターの異なるセット)を持つことができます
  • タイプ固有の戻り値:各関数には、特定の戻り値タイプ(文字列、整数、ブール値、日付、リストなど)があります
  • 0~N 個のパラメーター:関数は 0~N 個の式を順序付きパラメーターとして受け入れることができるので、使用方法を柔軟に指定できます

関数を使用する理由

関数を使用すると、次の操作を実行できます。

  • 動的条件を作成 - リアルタイムデータ評価に基づいてジャーニーパスを分岐します
  • 大規模にパーソナライズ - お客様データと行動インサイトを活用してコンテンツとエクスペリエンスをカスタマイズします。
  • 決定を自動化 - 手動介入なしでインテリジェントロジックを作成します
  • データを変換 - 互換性を確保するために、データタイプを変換、書式設定、操作します
  • 計算を実行 - 数学演算と統計的な分析を実行します
  • 入力を検証 - アクションを実行する前に、データの品質と完全性を確認します

カテゴリ別関数

主な目的別に整理された関数を参照して、ニーズに合った適切なツールをすばやく見つけます。

Adobe Experience Platform aep-functions

オーディエンスのセグメント化とターゲティング

オーディエンスメンバーシップを評価し、Adobe Experience Platform で定義された顧客セグメントに基づいてパーソナライズされたジャーニーパスを作成します。

関数
説明
inAudience
個人が特定のオーディエンスに属しているかどうかを確認します

Adobe Experience Platform の関数の詳細を表示 →

集計関数 aggregation-functions

統計計算とデータ要約

値のセットに対して計算を実行し、平均値、カウント、合計値、最小値/最大値などのインサイトを導き出します。 データ駆動型の意思決定に不可欠です。

関数
説明
avg
平均値を計算します
count
null 以外の要素をカウントします
countOnlyNull
null 値のみをカウントします
countWithNull
null を含むすべての要素をカウントします
distinctCount
一意の null 以外の値をカウントします
distinctCountWithNull
null を含む一意の値をカウントします
max
最大値を見つけます
min
最小値を見つけます
sum
合計を計算します

すべての集計関数を表示 →

コンバージョン関数 conversion-functions

データタイプ変換

操作とデータソース間の互換性を確保するために、様々なタイプ(文字列、整数、小数、ブール値、日付、期間)間でデータを変換します。

関数
説明
toBool
ブール値に変換します
toDateOnly
日付のみ(時間なし)に変換します
toDateTime
時刻付きで日付に変換します
toDateTimeOnly
タイムゾーンなしの日付と時刻に変換します
toDecimal
小数に変換します
toDuration
期間に変換します
toInteger
整数に変換します
toString
文字列に変換します

すべてのコンバージョン関数を表示 →

日付関数 date-functions

日時の操作

日付、時刻、タイムゾーンを操作して、時間ベースの条件を作成し、アクションをスケジュールし、時間計算を実行します。

関数
説明
currentTimeInMillis
現在の時刻をミリ秒単位で取得します
dateDiff
2つの日付または日時の違いを計算します
inLastDays
日付が過去 N 日以内かどうかを確認します
inLastHours
日付が過去 N 時間以内かどうかを確認します
inLastMonths
日付が過去 N か月以内かどうかを確認します
inLastYears
日付が過去 N 年以内かどうかを確認します
inNextDays
日付が次の N 日以内かどうかを確認します
inNextHours
日付が次の N 時間以内かどうかを確認します
inNextMonths
日付が次の N か月以内かどうかを確認します
inNextYears
日付が次の N 年以内かどうかを確認します
now
現在の日時を取得します
nowWithDelta
オフセット付きで現在の時刻を取得します
setHours
日時で特定の時間を設定します
setDays
日時で特定の日付を設定します
updateTimeZone
日時のタイムゾーンを更新します

すべての日付関数を表示 →

リスト関数 list-functions

コレクションの操作と分析

配列やリストをフィルタリング、並べ替え、変換、分析して、複雑なデータ構造を操作したり、積集合、和集合、差分などのセット操作を実行したりできます。

関数
説明
differenceLists
あるリスト内の項目が別のリストに存在しない
distinct
一意の値を取得します(null は除外されます)
distinctWithNull
一意の値を取得します(null を含みます)
filter
条件に基づいてリストをフィルタリングします
getListItem
特定のインデックスの項目を取得します
in
リストに値が存在するかどうかを確認します
intersect
リスト間の共通要素を見つけます
limit
返される項目の数を制限します
listSize
リストのサイズを取得します
mergeLists
重複排除の有無にかかわらず、2つのリストを結合
serializeList
リストを文字列に変換します
sort
リスト要素を並べ替えます

すべてのリスト関数を表示 →

数学関数 math-functions

数学演算

データ処理とビジネスロジックに対して数値計算と変換を実行します。

関数
説明
random
乱数(0~1)を生成します
round
最も近い整数に丸めます

すべての数学関数を表示 →

文字列関数 string-functions

テキストの操作と検証

動的コンテンツの作成と条件付きロジック用にテキストデータを処理、変換、検索、検証します。

関数
説明
concat
文字列を連結します
contain
文字列に部分文字列が含まれているかどうかを確認します
containIgnoreCase
「次を含む」を確認します(大文字と小文字は区別されません)
endWith
文字列が接尾辞で終わるかどうかを確認します
endWithIgnoreCase
「次で終わる」を確認します(大文字と小文字は区別されません)
equalIgnoreCase
文字列を比較します(大文字と小文字は区別されません)
indexOf
最初の発生位置を検索します
isEmpty
文字列が空かどうかを確認します
isNotEmpty
文字列が空でないかどうかを確認します
lastIndexOf
最後の発生位置を検索します
length
文字列の長さを取得します
lower
小文字に変換します
matchRegExp
正規表現に一致します
notEqualIgnoreCase
「次と等しくない」を確認します(大文字と小文字は区別されません)
replace
最初の発生を置き換えます
replaceAll
すべての発生を置き換えます
split
文字列を配列に分割します
startWith
文字列が接頭辞で始まるかどうかを確認します
startWithIgnoreCase
「次で始まる」を確認します(大文字と小文字は区別されません)
substr
部分文字列を抽出します
trim
先頭/末尾のスペースを削除します
upper
大文字に変換します
uuid
UUID を生成します

すべての文字列関数を表示→

次の手順

使用可能な機能を理解したら、次を参照してください。

  • 高度な式エディター - 高度なエディターを使用して複雑な式を作成する方法について説明します
  • 式の構文 - ジャーニー式を記述するための構文ルールを習得します
  • 演算子 - 関数でロジックを作成するために使用できる演算子について説明します
  • フィールド参照 - 式でデータフィールドを参照する方法について説明します
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 is a categorized reference of all 60+ built-in functions available in the Journey advanced expression editor, covering aggregation, conversion, date/time, list, math, string, and Adobe Experience Platform audience functions.

Intents:

  • Identify the right function for a task by browsing the categorized function tables
  • Transform data types between string, integer, decimal, boolean, date, and duration using conversion functions
  • Perform date-based filtering with functions like inLastDays, inNextHours, nowWithDelta, and dateDiff
  • Manipulate and validate string values using functions like contain, replace, split, and trim
  • Perform statistical calculations on collections using aggregation functions like count, avg, sum, and distinctCount
  • Check audience membership in journey conditions using the inAudience function

Glossary:

  • Aggregation functions: Functions that compute a single value (count, sum, average, min, max) from a collection of values (product-specific)
  • Conversion functions: Functions that cast a value from one data type to another (e.g. toString, toDateTime, toDuration) (product-specific)
  • Date functions: Functions for working with date, time, and timezone values in journey expressions (product-specific)
  • List functions: Functions for filtering, sorting, and analyzing array/collection data (product-specific)
  • inAudience: A function that checks whether a profile belongs to a specified Adobe Experience Platform audience segment (product-specific)

Guardrails:

  • Functions follow a consistent syntax: functionName(param1, param2, ...)
  • A function may have multiple signatures (different parameter sets) to handle different use cases
  • Each function has a fixed return type — ensure the return type matches what the expression context expects
  • The functions available in the Journey expression editor differ from those in the personalization editor

Terminology:

  • Canonical name: Functions — Acronym: none — variants: built-in functions, expression functions
  • Synonyms: “aggregation functions” = “statistical functions”; “conversion functions” = “type casting functions”
  • Do not confuse: journey expression functions ≠ personalization editor functions (different sets)

FAQ:

  • Q: How many functions are available in the Journey expression editor? — Over 60 functions organized across categories including aggregation, conversion, date, list, math, string, and Adobe Experience Platform.
  • Q: How do I check if a profile belongs to an audience in a journey condition? — Use the inAudience function with the audience identifier.
  • Q: What function should I use to get the current date and time offset by a number of days? — Use nowWithDelta(N, "days") to get a dateTime offset from the current time.
  • Q: How can I calculate the difference between two dates? — Use the dateDiff function. Both parameters must be the same type: dateOnly parameters return the difference in days, while dateTimeOnly and dateTime parameters return the difference in milliseconds.
  • Q: Can a function return different types depending on how it is called? — A function has a specific return type per signature, but a single function name can have multiple signatures with different parameter sets and return types.
  • Q: What is the difference between count and countWithNull?count counts only non-null elements; countWithNull counts all elements including nulls.
recommendation-more-help
journey-optimizer-help