---
title: "JSONPath Logical Filters & Wildcard XPaths in Orchestrate"
description: "Fix compound JSONPath filters (&&, ||) returning empty results in Workday Orchestrate and use wildcard XPaths in stringAtXpathWithDefault safely."
url: https://kiweely.com/guides/workday-orchestrate-jsonpath-logical-filters-xpath-wildcards
---

# JSONPath Logical Filter Expressions and Wildcard XPaths in Workday Orchestrate

Compound JSONPath filter expressions (&&, ||) in Workday Orchestrate fail silently when typographic quotes are pasted or unsupported filter tokens are chained. Learn the supported JSONPath and wildcard XPath syntax and when to replace SOAP launch polling with Trigger Integration.

-   **Checked** against Workday on November 6
-   Applies to **Workday Orchestrate**
-   3 min read
-   Published November 6
-   By Kiweely

## Why Compound JSONPath Filters (`||` and `&&`) Return Empty Results in Orchestrate

Workday Orchestrate supports compound logical comparison filters (`||` and `&&`) inside `[?(...)]` predicates on `Json` member functions such as `.objectAtJsonPath()`, `.valuesAtJsonPathAsArray()`, and `.iterator()`. When a compound filter works in an external RFC 9535 JSONPath evaluator but returns empty data or fails in **Orchestration Builder**, one of three platform-specific issues is responsible:

### 1\. Typographic (Curly) Single Quotes Inside `[?(...)]`

Copying a JSONPath expression from documentation, chat, or a rich-text editor frequently replaces straight ASCII single quotes (`'` / `0x27`) with typographic curly quotes (`‘` and `’`):

javascript

```
// FAILS — curly quotes ‘ and ’ prevent matching and return empty results
$.data[?( @.employee.suporg.id == ‘e02485f863ec48d39a082bb95cc4abe4’ || @.employee.suporg.id == ‘1ad7d37487904a989b2db1bfa6fed57d’ )]
```

Replace every quote inside the predicate with straight ASCII single quotes (`'`):

javascript

```
// WORKS — straight ASCII single quotes inside a single filter block
data.WorkerResponse.response
  .asJSON()
  .valuesAtJsonPathAsArray(
    "$.data[?( @.employee.suporg.id == 'e02485f863ec48d39a082bb95cc4abe4' || @.employee.suporg.id == '1ad7d37487904a989b2db1bfa6fed57d' )]"
  )
```

### 2\. Chained Filter Tokens (`[?(...)][?(...)]`) vs. Single `&&` Predicate

As documented in **Concept: JSONPath Support**, Orchestration Builder explicitly rejects **filter tokens followed by filter tokens**:

| JSONPath Pattern | Support in Orchestrate | Behavior |
| --- | --- | --- |
| `$.data[?( @.hasAction == true )][?( @.employee.isTermed == false )]` |  **Not Supported** | Chained filter tokens fail validation or return empty results. |
| `$.data[?( @.hasAction == true && @.employee.isTermed == false )]` |  **Supported** | Combines both conditions using `&&` inside a single `[?( ... )]` token. |
| `$.data[?( @.id == $.defaultId )]` |  **Not Supported** | Filters that refer to root (`$`) or compare two dynamic subqueries (`@['a'] < @['b']`) are not supported. |

### 3\. `objectAtJsonPath` vs. `valuesAtJsonPathAsArray` on Filtered Arrays

A filter expression `$.data[?(...)]` evaluates against an array and can match zero, one, or multiple elements (up to Orchestrate’s 10,000-primitive JSONPath selection ceiling):

-   Calling `.objectAtJsonPath("$.data[?(...)]")` expects a single JSON object match. If you use a pre-check expression or call `objectAtJsonPath` when multiple array elements match (or zero match without `WithDefault`), the pre-check fails.
-   Use `.countItemsAtJsonPath("$.data[?(...)]") > 0` or `.isValueAtJsonPath("$.data[?(...)]")` for existence pre-checks, and `.valuesAtJsonPathAsArray("$.data[?(...)]")` or `.iterator("$.data[?(...)]")` to extract all matching array elements safely.

* * *

## Using the Wildcard Operator (`*`) in `stringAtXPathWithDefault` and `numberAtXPathWithDefault`

When parsing Workday SOAP responses—such as extracting `Parent_Event_Reference/ID` from `Launch_Integration_Event_Response` or `Total_Results` from `Get_Integration_Events_Response`—Orchestration Builder supports the wildcard `*` and descendant `//` operators in `stringAtXPathWithDefault` and `numberAtXPathWithDefault`:

javascript

```
// Extract Parent_Event_Reference WID using wildcard prefixes for Envelope/Body
data.LaunchIntegrationSoap.response
  .asXML()
  .stringAtXPathWithDefault(
    "/*/*/wd:Launch_Integration_Event_Response/wd:Integration_Event/wd:Integration_Event_Data/wd:Parent_Event_Reference/wd:ID[@wd:type='WID']",
    ""
  )

// Extract Total_Results as a Number with a fallback of 0
data.GetIntegrationEventsSoap.response
  .asXML()
  .numberAtXPathWithDefault(
    "/*/*/wd:Get_Integration_Events_Response/wd:Response_Results/wd:Total_Results",
    0
  )
```

### Why a Working Wildcard XPath Suddenly Returns the Default Value

If an orchestration with `/*/*/Parent_Event_Reference/ID` worked in one version or debug session and suddenly returns the default value (`""` or `0`), check these three XML rules:

1.  **XML Namespace Prefixes (`wd:` vs. `excludeAllNamespaces()`):** Workday SOAP responses bind elements to `xmlns:wd="urn:com.workday/bsvc"`. While `/*/*` matches the outer `<env:Envelope>` and `<env:Body>` regardless of namespace, named child elements (`Parent_Event_Reference/ID`) require the `wd:` prefix unless you strip namespaces first with `.excludeAllNamespaces()`:
    
    javascript
    
    ```
    data.LaunchIntegrationSoap.response
      .asXML()
      .excludeAllNamespaces()
      .stringAtXPathWithDefault("/*/*/*/Integration_Event/Integration_Event_Data/Parent_Event_Reference/ID[@type='WID']", "")
    ```
    
2.  **Leaf-Node-Only Extraction Rule:** In Orchestrate, `stringAtXPathWithDefault` and `numberAtXPathWithDefault` extract values from **leaf nodes or attributes only**. If the XPath points to a parent element that contains child tags (such as `Parent_Event_Reference` instead of `Parent_Event_Reference/wd:ID`), the function returns no data. Only `iterator()`, `fragmentAtXPath()`, and `countItemsAtXPath()` can select non-leaf XML fragments.
3.  **SOAP Fault Responses:** If the SOAP call returned a `<SOAP-ENV:Fault>` with HTTP 200 or 500, `stringAtXPathWithDefault` evaluates against the fault XML and silently returns the default value `""`. Always check `data.LaunchIntegrationSoap.response.isSoapFault().not()` before extracting response fields.

### Prefer `Trigger Integration` Over Manual SOAP Launch + XPath Polling

If you are calling `Launch_Integration_Event_Request` over SOAP and polling `Get_Integration_Events_Request` with `numberAtXPathWithDefault` to wait for a child integration to finish, replace both SOAP steps with Orchestrate’s native **Trigger Integration** component. **Trigger Integration** launches the child integration, pauses the parent orchestration automatically until the child integration completes, and exposes its status, messages, and output documents directly without XPath polling.

* * *

## Verifying Your JSONPath and XPath Expressions in the Tenant

1.  In **Orchestration Builder**, test your JSONPath filter inside a **Create Values** step using `.countItemsAtJsonPath("$.data[?(...)]")` and `.valuesAtJsonPathAsArray("$.data[?(...)]")` in **DebugOrchestrations** mode to verify the exact match count before consuming the result downstream.
2.  For XML responses, inspect the raw XML step output in the debugger panel, verify whether namespace prefixes (`wd:` or `bsvc:`) are present, and confirm the target node is a leaf element (`wd:ID` or `wd:Total_Results`).

## Sources checked

-   [Concept: JSONPath Support](https://developer.workday.com/documentation/GUID-d1c2ce08-a02e-4803-8347-207f3c3b2d30)
-   [Concept: XPath Support](https://developer.workday.com/documentation/GUID-0d3d49d3-62b4-4d1a-9baf-008de23ca696)
-   [Reference: Json Member Functions](https://developer.workday.com/documentation/GUID-85d61153-4a66-41e7-ad4f-921b0e9a152e)
-   [Reference: Xml Member Functions](https://developer.workday.com/documentation/GUID-dddc9b74-8efd-4a2f-8c69-7e3ce71ed6fb)

## Related guides

[All guides](https://kiweely.com/guides)

-   [### Reading Integration Launch Attachments, Calling SOAP Integrations API, and Uploading ZIPs to Workday Drive in O4I In Orchestrate for Integrations (O4I), read launch files via an Integration Retrieval Service (‘Attach file at launch’) and documents.get(0). For Get\_Event\_Documents over SOAP, use /soap/v46.2/Integrations with .wrapSoapV11(), and test Workday Drive ZIP uploads outside Debug Mode.](https://kiweely.com/guides/workday-orchestrate-read-integration-attachment-retrieval-service)
-   [### Generating UUIDs with random.randomUUID() and Fixing stringAtJsonPath().toNumber() in Orchestrate Workday Orchestrate uses random.randomUUID() instead of PMD’s UUID() function to generate unique batch IDs, and requires chaining .toNumber() on the outer stringAtJsonPath() function rather than inside the JSONPath literal.](https://kiweely.com/guides/workday-orchestrate-randomuuid-stringatjsonpath-tonumber)
-   [### Waiting for Import\_Payroll\_Input\_Request Background Processes at Scale in Workday Orchestrate Calling Import\_Payroll\_Input\_Request in Workday Orchestrate spawns an asynchronous background process. Instead of polling WQL in a fixed-iteration loop, invoke the import inside a child O4I integration via Trigger Integration, which waits for all spawned background jobs to complete before resuming.](https://kiweely.com/guides/workday-orchestrate-wait-background-process-import-payroll-input)
-   [### Sorting JsonKeyValueIterator Collections and Numeric String Values in Workday Orchestrate Loops Workday Orchestrate fails at build time when sorting a JsonKeyValueIterator loop by item.key(), and sorts numeric strings lexicographically (‘1’, ‘1000’, ‘3’). Use a two-loop key extraction pattern for JSON objects and cast string IDs with toNumber() in Loop Sort By.](https://kiweely.com/guides/workday-orchestrate-sort-jsonkeyvalueiterator-numeric-sorting)

### More guides on Orchestrate

[All 86 guides](https://kiweely.com/guides#orchestrate)

-   [Preventing Duplicate Records on Orchestration Rerun and Concurrent Webhook Triggers in Workday](https://kiweely.com/guides/workday-orchestrate-idempotency-concurrent-webhooks-duplicates)
-   [Reading the HTTP Response Content-Type Header in Workday Orchestrate](https://kiweely.com/guides/workday-orchestrate-http-response-content-type-header)
-   [Transforming dynamic-key JSON to CSV and grouping flat CSV rows into nested JSON in Orchestrate](https://kiweely.com/guides/workday-orchestrate-dynamic-json-keys-to-csv-grouped-json)
-   [Custom CSV formatting in Workday Orchestrate: Windows CRLF line endings, title rows, and skipping preamble lines](https://kiweely.com/guides/workday-orchestrate-csv-crlf-title-row-skip-header-lines)
-   [Resolving ‘\[StepException\] requirement failed: Input lists must be of the same size’ in createReferenceList](https://kiweely.com/guides/workday-orchestrate-createreferencelist-input-lists-same-size)
-   [Fixing ‘Fast forwarding to correct position’ and 45-minute timeouts in Orchestrate batchLoop](https://kiweely.com/guides/workday-orchestrate-batchloop-paginatedget-fast-forwarding-timeout)
-   [Overcoming ‘Message length should be lesser than 1MB in size’ and ‘Orchestration is too large to be saved’](https://kiweely.com/guides/workday-orchestrate-1mb-message-limit-too-large-to-save)
-   [Handling Silent GraphQL Errors in PMD and Orchestrate When HTTP Status Returns 200 OK](https://kiweely.com/guides/workday-graphql-http-200-silent-mutation-errors)

### From the blog on Orchestrate

[All posts](https://kiweely.com/blog)

-   [Why Workday Studio Remains Essential in an Orchestrate World](https://kiweely.com/blog/why-workday-studio-still-matters-with-orchestrate)
-   [Debugging Workday Extend apps and orchestrations in kiweely](https://kiweely.com/blog/debugging-workday-extend-apps-orchestrations-kiweely)
-   [Kiweely Roots vs Workday EIB, Studio, and Orchestrate](https://kiweely.com/blog/kiweely-roots-vs-workday-eib-studio-orchestrate)

## Let Workday check the work.

Kiweely writes WQL and builds orchestrations in your own tenant, and Workday, not Kiweely, says whether they passed.

[Start for free](https://kiweely.com/download) [See how it works](https://kiweely.com/vine/how-it-works)

## Get the next guide in your inbox.

One email a month with new guides and one Extend tip. Nothing else.
