Skip to content
KiweelyKiweelyKiweely

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
  • Applies to Workday Orchestrate
  • 3 min read
  • Published
  • By Kiweely
On this page

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
JSONPath Pattern$.data[?( @.hasAction == true )][?( @.employee.isTermed == false )] Support in OrchestrateNot Supported BehaviorChained filter tokens fail validation or return empty results.
JSONPath Pattern$.data[?( @.hasAction == true && @.employee.isTermed == false )] Support in OrchestrateSupported BehaviorCombines both conditions using && inside a single [?( ... )] token.
JSONPath Pattern$.data[?( @.id == $.defaultId )] Support in OrchestrateNot Supported BehaviorFilters 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

Related guides

All guides

Let Workday check the work.

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

Get the next guide in your inbox.

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

We’ll email you once to confirm. Unsubscribe in one click from any issue.