HR Integrations : Retrieving Multiple Records with Same person_id_external in CompoundEmployee API

Aniket16
Tera Contributor

Hello ServiceNow Community,

I'm working with the CompoundEmployee API (HR Integrations : Worker Profiles), and I've encountered a situation where there are two records with the same person_id_external. Currently, my API request only retrieves one of these records. I would like to know what changes I can make in my API request to retrieve both records associated with the same person_id_external. Any guidance or examples would be greatly appreciated.

Thank you!

This is my current API request :

Aniket16_0-1695041466271.png

 

6 REPLIES 6

palanikumar
Mega Sage

I see a condition in your input where it checks for effective_end_date. Check whether effective end date is not current date for the duplicate record. If not current then remove the where condition and try

Thank you,
Palani

Thank you for your input @palanikumar ! When I remove the where condition , the API doesn't return any records in the response, even for the other records.

Hi Aniket,

 

Did you try removing the lines mentioned below:

palanikumar_0-1695297167613.png

 

Thank you,
Palani

JamesEcoStratus
Mega Guru

Hello, 

 

Based on my understanding of your question from the information you’ve provided, see my reply below.

 

It seems like you're trying to retrieve multiple records associated with the same person_id_external using the ServiceNow CompoundEmployee API. You can modify your XML request to include a condition that retrieves records based on the person_id_external. Here's an example of how you can modify your XML request:

 

Screenshot 2023-09-18 at 12.54.53.png

 

In this modified XML request, replace 'your-person-id-external' with the actual person_id_external value you want to query. This request will retrieve records with a matching person_id_external value, allowing you to get multiple records associated with the same person_id_external.

 

Good Luck!

 

James @Ecostratus

 

If I helped you with your question, then please hit the Thumb Icon and mark it as Helpful or Correct.