Not getting the correct record in Retrieve Worker Profile Staging table from SuccessFactors Spoke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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.
