Hear from Salesforce leaders on how to create and deploy Agentforce agents.
Contact Us 1-800-596-4880

nodeExists

nodeExists(value: Any, callback: (value: Any, path: Path) -> Boolean): Boolean

Returns true if any node in a given tree validates against the specified criteria.

Introduced in DataWeave version 2.2.2.

Parameters

Name Description

value

The value to search.

callback

The criteria to apply to the input value.

Example

This example checks for each user by name and last name. Notice that you can also reference a value with $ and the path with $$.

Source

Output

{
  "mariano": true,
  "julian": true,
  "tom": true,
  "leandro": true,
  "peter": true,
  "wrongField": false,
  "teo": false
}
Json