Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

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?

3 REPLIES 3

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.

Is the query for start and end date be added in the SOAP Message of the Action Retrieve Worker Profile?

Or should I use the Retrieve Effective Worker Profile? There is somehow a similar query for Retrieve Effective Worker Profile.

I would not recommend modifying the SOAP message of the OOTB Retrieve Worker Profile action, as this can cause upgrade and maintenance issues.

A safer approach is either:
- Use Retrieve Effective Worker Profile with effectiveDate = today (if it returns the correct active job in your tenant)
OR
- Keep the standard action and add post-processing logic in the flow to filter the returned jobs using effective dating (startDate ≤ today AND endDate is empty or ≥ today).
The second approach gives more control and is upgrade-safe.