Skip to content

Selectors

Selectors identify which JSON object a rule evaluates. They are wrapped in double asterisks: **Name**.

Basic Selectors

A selector maps to a top-level key in the JSON data:

**Person** → data.Person
**User** → data.User
**Order** → data.Order

Selectors can contain spaces:

**driving test** → data["driving test"]

Nested Selectors

Use dot notation to reference nested objects:

**user.profile** → data.user.profile
**driving test.theory** → data["driving test"].theory

Interactive Example

Policy Rule
Test Data (JSON)

Multiple Selectors

A rule can reference multiple selectors. This is useful for comparing data across objects:

A **Application** gets approved
if __age__ of **Applicant** is greater than 18
and __score__ of **CreditCheck** is greater than 700.

Each selector must exist as a key in the provided data:

{
"Applicant": { "age": 25 },
"CreditCheck": { "score": 750 }
}

Interactive Example

Policy Rule
Test Data (JSON)

Case Sensitivity

Selector names are case-sensitive and must match the JSON keys exactly:

  • **Person** matches { "Person": { ... } }
  • **person** matches { "person": { ... } }

Articles

Rules start with A or An before the selector. These are required syntax but don’t affect evaluation:

A **Person** gets approved ...
An **Application** is valid ...