演算子 operators

演算子には、単項演算子と二項演算子の 2 種類があります。 左単項演算子と右単項演算子があります。

// left-hand unary operators
// <operator> <operand>
// operand is an expression
not (@event{LobbyBeacon.endUserIDs._experience.emailid.id}=="example@adobe.com")

// right-hand unary operators
// <operator> <operand>
// operand is an expression
@event{LobbyBeacon.endUserIDs._experience.emailid.id} is not null

// binary operators
// <operand1> <operator> <operand2>
// operand is an expression
(@event{LobbyBeacon.endUserIDs._experience.emailid.id}=="example1@adobe.com") or (@event{LobbyBeacon.endUserIDs._experience.emailid.id}=="example2@adobe.com")

重要な注意事項 important-notes

  • 乗算(*)の場合、両方の演算フィールドのタイプは整数または 10 進数で同じにする必要があります。 例:

    • 以下の例は正しいです。3.0 * 4.0
    • 3 * 4.0 はエラーを引き起こします
  • + 演算子を使用する場合、式を括弧で囲む必要があります。 例:

    • toDateTimeOnly(toDateTime((currentTimeInMillis()) + 1)) は正しいです
    • toDateTimeOnly(toDateTime(currentTimeInMillis() + 1)) はエラーを引き起こします

論理 logical

and

<expression1> and <expression2>

<expression1> と <expression2> は両方ともブール値である必要があります。 結果はブール値です。

例:

3.14 > 2 and 3.15 < 1

or

<expression1> or <expression2>

<expression1> と <expression2> は両方ともブール値である必要があります。 結果はブール値です。

例:

3.14 > 2 or 3.15 < 1

not

not <expression>

<expression> はブール値である必要があります。 結果はブール値です。

例:

not 3.15 < 1

比較 comparison

is null

<expression> is null

結果はブール値です。

null は、式に評価値がないことを意味します。

例:

@event{BarBeacon.location} is null

is not null

<expression> is not null

結果はブール値です。

null は、式に評価値がないことを意味します。

例:

@event{BarBeacon.location} is not null

has null

<expression> has null

<expression> はリストである必要があります。 結果はブール値です。

リストに少なくとも 1 つの null 値が含まれているかどうかを識別するのに役立ちます。

例:

["foo", "bar", null] has null

true を返します

["foo", "bar", ""] has null

“” が null と見なされないので、false を返します。

==

<expression1> == <expression2>
NOTE
<expression1> と <expression2> には、データタイプコントロールはありません。

例:

3.14 == 42
"foo" == "bar"

!=

<expression1> != <expression2>
NOTE
<expression1> と <expression2> には、データタイプコントロールはありません。

結果はブール値です。

例:

3.14 != 42
"foo" != "bar"

>

<expression1> > <expression2>

日時は日時と比較できます。

「日時のみ」は「日時のみ」と比較することができます。

整数と小数はどちらも、整数と小数の両方と比較できます。

その他の組み合わせは禁止されています。

結果はブール値です。

例:

3.14 > 42

>=

<expression1> >= <expression2>

日時は日時と比較できます。

「日時のみ」は「日時のみ」と比較することができます。

整数と小数はどちらも、整数と小数の両方と比較できます。

その他の組み合わせは禁止されています。

結果はブール値です。

例:

42 >= 3.14

<

<expression1> < <expression2>

日時は日時と比較できます。

「日時のみ」は「日時のみ」と比較することができます。

整数と小数はどちらも、整数と小数の両方と比較できます。

その他の組み合わせは禁止されています。

結果はブール値です。

例:

42 < 3.14

<=

<expression1> <= <expression2>

日時は日時と比較できます。

「日時のみ」は「日時のみ」と比較することができます。

整数と小数はどちらも、整数と小数の両方と比較できます。

その他の組み合わせは禁止されています。

結果はブール値です。

例:

42 <= 3.14

算術計算 arithmetic

+

<expression1> + <expression2>

両方の式は数値(整数または小数)である必要があります。

結果も数値です。

例:

1 + 2

3 を返します

-

<expression1> - <expression2>

両方の式は数値(整数または小数)である必要があります。

結果も数値です。

例:

2 - 1

1 を返します

/

<expression1> / <expression2>

両方の式は数値(整数または小数)である必要があります。

結果も数値です。

<expression2> は 0 以外である必要があります(0 の場合は戻り値が 0 になります)。

例:

4 / 2

2 を返します

*

<expression1> * <expression2>

両方の式は数値(整数または小数)である必要があります。

結果も数値です。

例:

3 * 4

12 を返します

%

<expression1> % <expression2>

両方の式は数値(整数または小数)である必要があります。

結果も数値です。

例:

3 % 2

1 を返します。

数値計算 math

is numeric

<expression> is numeric

式のタイプは整数または小数です。

例:

@ is numeric

is integer

<expression> is integer

式のタイプは整数です。

例:

@ is integer

is decimal

<expression> is decimal

式のタイプは小数です。

例:

@ is decimal

文字列 string

+

<string> + <expression>
<expression> + <string>

2 つの式を連結します。

一方の式は、連結される文字列である必要があります。

例:

"the current time is " + (now())

「現在の時刻は 2023-09-23T09:30:06.693Z です」を返します

(now()) + " is the current time"

「2023-09-23T09:30:06.693Z は現在の時刻です」を返します

"a" + "b" + "c" + 1234

「abc1234」を返します

日付 date

+

<expression> + <duration>

日時、日時のみ、期間のいずれかに期間を連結します。

例:

(toDateTime("2023-12-03T15:15:30Z")) + (toDuration("PT15M"))

dateTime 2023-12-03T15:30:30Z を返します

(toDateTimeOnly("2023-12-03T15:15:30")) + (toDuration("PT15M"))

dateTimeOnly 2023-12-03T15:30:30 を返します

(now()) + (toDuration("PT1H"))

dateTime (UTC タイムゾーンを使用)現在の時刻から 1 時間後を返します

(toDuration("PT1H")) + (toDuration("PT1H"))

duration PT2H を返します

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 complete reference of operators available in the Journey advanced expression editor, covering logical (and, or, not), comparison (==, !=, >, >=, <, <=, is null, is not null, has null), arithmetic (+, -, /, *, %), math type-check (is numeric, is integer, is decimal), string concatenation, and date arithmetic operators.

Intents:

  • Combine boolean conditions using logical operators and, or, and not
  • Check whether a field or expression value is null or not null using is null / is not null
  • Detect null values within a list using the has null operator
  • Compare numeric, datetime, and datetimeonly values using >, >=, <, <=, ==, and !=
  • Perform arithmetic on numeric values using +, -, /, *, and %
  • Add a duration to a dateTime, dateTimeOnly, or duration value using the + operator

Glossary:

  • Unary operator: An operator applied to a single operand; can be left-hand (e.g. not) or right-hand (e.g. is null) (product-specific)
  • Binary operator: An operator applied between two operands (e.g. and, ==, +) (product-specific)
  • has null: A right-hand unary operator that returns true if a list contains at least one null element (product-specific)
  • is numeric / is integer / is decimal: Type-check operators that return a boolean based on the numeric subtype of the expression (product-specific)

Guardrails:

  • When using multiplication (*), both operands must be the same numeric type (both integer or both decimal) — mixing types causes an error
  • When using the + operator for date arithmetic, the expression must be wrapped in parentheses to avoid parsing errors
  • Comparison operators (>, >=, <, <=) are only valid between compatible types: Datetime with Datetime, DatetimeOnly with DatetimeOnly, or numeric with numeric — any other combination is forbidden
  • An empty string "" is not considered null — has null returns false for a list containing ""
  • The == and != operators perform no data type control between operands

Terminology:

  • Canonical name: Operators — Acronym: none — variants: expression operators, journey operators
  • Synonyms: and = “logical AND”; or = “logical OR”; not = “logical NOT”; % = “modulo”
  • Do not confuse: is null (expression has no evaluated value) ≠ == null (not a valid syntax); has null (list contains null) ≠ is null (expression itself is null)

FAQ:

  • Q: Can I multiply an integer by a decimal directly? — No; both operands of * must be the same type. Use 3.0 * 4.0 (both decimal) or 3 * 4 (both integer).
  • Q: How do I add 15 minutes to a dateTime? — Use (toDateTime("...")) + (toDuration("PT15M")).
  • Q: What is the difference between is null and has null?is null checks whether a single expression has no evaluated value; has null checks whether a list contains at least one null element.
  • Q: Does "" has null return true? — No; an empty string is not considered null, so the result is false.
  • Q: Why does 3 * 4.0 cause an error? — The * operator requires both operands to be the same numeric type; mixing integer and decimal is not allowed.
recommendation-more-help
journey-optimizer-help