Workday XPTH for action reason

:bangbang: Please be sure you’ve read the docs and API specs before asking for help. Also, please be sure you’ve searched the forum for your answer before you create a new topic.

I am looking for hep to build XPATH to retrieve action reason from the following XML. My need is to get “Resignation”, which is a descriptor for End_Employment_Reason_Reference.

<wd:Worker_Job_Data wd:Primary_Job=“1”>
<wd:Position_Data wd:Effective_Date=“2025-10-25”>
<wd:Position_Reference wd:Descriptor=“John Doe”>
<wd:ID wd:type=“WID”>99999991e94fc445d6b90000</wd:ID>
<wd:ID wd:type=“Position_ID”>9999</wd:ID>
</wd:Position_Reference>
wd:Position_ID9999</wd:Position_ID>
wd:Position_TitleDirector</wd:Position_Title>
wd:Business_TitleDirector</wd:Business_Title>
wd:Start_Date2020-01-01</wd:Start_Date>
<wd:End_Employment_Reason_Reference wd:Descriptor=“Resignation”>

Welcome back to the community!

We do something similar but instead of checking the end employment reason reference at the “position” level in Workday we use the primary termination reason reference at the worker level. You are missing the full tree in the XML sample you provided so I cant provide the XPATH but if you use @ns1:Descriptor at the end of your full path to the attribute it should give you that value. As an example in my case this is my XPATH for the descriptor of the primary termination reason reference: ns1:Worker_Data/ns1:Employment_Data/ns1:Worker_Status_Data/ns1:Primary_Termination_Reason_Reference/@ns1:Descriptor

I hope this helps!

Hi @HPatel

Based on the XML you shared, the XPath would be:

“ns1:Worker_Data/ns1:Employment_Data/ns1:Worker_Job_Data/ns1:Position_Data/ns1:End_Employment_Reason_Reference/@ns1:Descriptor”

This should return Resignation from the “Descriptor” attribute.

For the Workday connector, make sure you use the namespace prefix configured for your source. SailPoint’s Workday connector uses “ns1:” for XPath mappings, so if your existing mappings use “ns1:”, I would use that rather than “wd:”.

Also, if the descriptor is not being returned during aggregation, check that Include_Reference_Descriptors_In_Response is enabled.

Its also worth noting that Sailpoint does have an XPATH evaluator tool where you can enter the XML input, your specific XPATH mappings and it will show what the response will include. So you could test these in that tool without having to mess with your existing working source connector. That tool is: XPath Evaluator | SailPoint Developer Community

Thak you Sangeetham

Where do I set “Include_Reference_Descriptors_In_Response”? I am on ISC and I do have ns1: namespace prefix.

I still get “Error! The account could not be aggregated. Try again.”

-Haresh

Thanks Eric for the suggestion.

I get “Error! The account could not be aggregated. Try again.”

-Haresh Patel

Thank you.

Here is the error message I get when I run source aggregation

Error!

[ ConnectorException ]
[ Error details ] Exception : net.sf.saxon.s9api.SaxonApiException: Errors were reported during stylesheet compilation

This setting is configured through the ISC REST API, rather than from the source UI.

The API request is:

PATCH "/v3/sources/{sourceId}"

Depending on the Workday connector implementation, use the corresponding attribute:

Workday connector:

[
  {
    "op": "add",
    "path": "/connectorAttributes/Include_Reference_Descriptors_In_Response",
    "value": "true"
  }
]

Workday SaaS connector:

[
  {
    "op": "add",
    "path": "/connectorAttributes/addReferenceDescriptorsInResponse",
    "value": "true"
  }
]

After enabling the appropriate setting, update the XPath to use @ns1:Descriptor in the XPath to retrieve Resignation.

For your XML:

"ns1:Worker_Data/ns1:Employment_Data/ns1:Worker_Job_Data/ns1:Position_Data/ns1:End_Employment_Reason_Reference/@ns1:Descriptor"

After updating the source, run the aggregation again and check the returned attribute.

you can try something like //*[local-name()=‘End_Employment_Reason_Reference’]/@*[local-name()=‘Descriptor’]

Thanks for the information. Include_Reference_Descriptors_In_Response is already set to true.

Aggregation failed with following error message

Error!

[ ConnectorException ]
[ Error details ] Exception : net.sf.saxon.s9api.SaxonApiException: Errors were reported during stylesheet compilation

XPATH is set to

ns1:Worker_Data/ns1:Employment_Data/ns1:Worker_Job_Data/ns1:Position_Data/ns1:End_Employment_Reason_Reference/@ns1:Descriptor

-Haresh

Hi @HPatel Are you using VA or SaaS connector?

We are using VA connector.

Your XPath looks good, however, you could add the Primary Job select back in:

ns1:Worker_Data/ns1:Employment_Data/ns1:Worker_Job_Data[@ns1:Primary_Job=1]/ns1:Position_Data/ns1:End_Employment_Reason_Reference/@ns1:Descriptor

Thanks Jeremy for the suggestion.

I still get following error

Error!

[ ConnectorException ]
[ Error details ] Exception : net.sf.saxon.s9api.SaxonApiException: Errors were reported during stylesheet compilation

Hi @HPatel That XPath is good, so maybe post the complete XPath_Schema_Mapping from the Source config json. Could be a rogue trailing space or something like that.

Jeremy’s suggestion makes sense. Since the updated XPath is valid but the same stylesheet compilation error persists, it would be useful to see the complete “Xpath_Schema_Mapping” from the source configuration.

That should help identify whether another XPath contains a trailing/hidden space or invalid expression that is causing the stylesheet compilation to fail.

Thank you everyone for your help.

Actually issue was with another exploratory XPATH added my teammate.

Once we removed it, my XPATH worked. Here is the final working XPATH

ns1:Worker_Data/ns1:Employment_Data/ns1:Worker_Status_Data/ns1:Primary_Termination_Reason_Reference/@ns1:Descriptor

-Haresh