We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Workday SAM Integration failing with "Cannot read property 'CountryRegionReference' from undefined"

Amit Bhatt
Tera Contributor

Hi Community,

I am facing an issue with the Workday Direct Integration for Software Asset Management (SAM). My integration is using a SOAP connection. The scheduled job is failing, and I am seeing a specific script error in the execution logs.

The Setup:

  • Integration: Workday SaaS License Management

  • Connection Type: SOAP

The Error: The flow "Workday Download Subscriptions" crashes at Step 8 (Set Flow Variables). The error log says: Error: Cannot read property "CountryRegionReference" from undefined

Technical Details: The error occurs in the scripted variable for Country. The OOB script is attempting to access: workerJobData[key1].PositionData.BusinessSiteAddressData[0].CountryRegionReference.CountryRegionID.

It seems that when a worker record has a primary job but no address data provided via the SOAP response, BusinessSiteAddressData[0] is undefined, causing the entire flow to fail. Consequently, the condition in Step 9 evaluates to False, and no subscriptions are updated.

Questions:

  1. Since this is an Out-of-the-Box (OOB) flow, is there a recommended way to handle missing address data without creating a custom copy of the flow?

  2. Has anyone else encountered this specific "undefined" crash with the Workday SAM spoke when certain worker fields are empty in Workday?

Any insights would be greatly appreciated!

1 REPLY 1

Tanushree Maiti
Giga Sage

Hi Amit,

 

I encountered lots of error during SAM Workday integration (Dec 2024) before it worked fine but not the specific error you are getting.

 

I will suggest, don't go with custom flow. It should work with OOB flow only. Log a case to vendor - they will help you to debug the oob flow (/error) .

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin: