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

Not getting the correct record in Retrieve Worker Profile Staging table from SuccessFactors Spoke

pjftenorio
Tera Guru

We have HR Integration in ServiceNow - SuccessFactors using SF Spoke, but the action/subflow Retrieve Worker Profile is not getting the correct record if the worker has 2 jobs

Example:

User has 2 jobs

- Old: Tagged as Employee but already Terminated

- New: Tagged as Contractor now (Active)

 

In Retrieve Worker Profile we are getting the Terminated record of the user despite using the OOTB. 

 

How to fix this?

1 REPLY 1

dhuynh28
Kilo Guru

Hi @pjftenorio ,

 

You can address this by filtering the employment records using effective dates instead of relying only on the OOTB logic.

When multiple jobs exist, the SuccessFactors response returns several records, and the Retrieve Worker Profile action may select the first one (which can be terminated). A more reliable approach is to choose the job where:

startDate <= today
AND (endDate is empty OR endDate >= today)

This ensures you pick the currently active employment even in rehire or multiple-job scenarios.

You can implement this by cloning the subflow or adding a script step after retrieving the job data to loop through the records and select the one matching the date criteria.