2365401 - How to mass delete external candidates

SAP Knowledge Base Article - Public

2365401 - How to mass delete external candidates

Symptom

The customer requires to delete a huge amount of candidates starting from a list of Candidate IDs.
The tool Admin Centre > Delete Candidate
allows to delete only one candidate ad the tame, then when the list is long this method is not feasible.

Resolution

Successfactors does not have a dedicate tool to achieve this.

However there is an alternative using oDATA integration.

NOTE: the method explained below required familiarity with oData integration, then we suggest to contact your Implementation Partner.

Prerequisites
The instance need to use DPCS 2.0 privacy setting.


Example: how to delete one candidate using oDATA

Let's consider a test candidate, Candidate ID "1706".
One of the fields in oData for the candidate profile is "agreeToPrivacyStatement".
This field is upseratable, so a candidate can be set to:
agreeToPrivacyStatement: false
and simulate the same action done using:  Admin Centre > Delete Candidate.

Sending the following oData request:

POST  ../odata/v2/Candidate

{

"__metadata":{

        "type":"SFOData.Candidate",

        "uri":"Candidate(1706)

        "

         },

"agreeToPrivacyStatement":"false"

}


we'll get this response as confirmation:

{

  "d": [

    {

      "key": null,

      "status": "OK",

      "editStatus": "UPDATED",

      "message": "Candidate has been updated successfully",

      "index": 0,

      "httpCode": 204,

      "inlineResults": null

    }

  ]

}



the result is that the anonymized Flag is now:  "Marked for anonymization by DPCS decline"

and this is exactly the same result that we get with using Delete Candidate.
After that, when the Anonymization (sceduled Job in back end) will run, the profile will be completely anonymized.

 

EXAMPLE: how the delete multiple candidates

We need just upsert several candidates in one single request.
Below the same code is repeated three times for CandidateId1, CandidateId2, CandidateId3 :

 

{

"__metadata":{

        "type":"SFOData.Candidate",

        "uri":"Candidate(CandidateId1)

        "

         },

"agreeToPrivacyStatement":"false"

}

{

"__metadata":{

        "type":"SFOData.Candidate",

        "uri":"Candidate(CandidateId2)

        "

         },

"agreeToPrivacyStatement":"false"

}

{

"__metadata":{

        "type":"SFOData.Candidate",

        "uri":"Candidate(CandidateId3)

        "

         },

"agreeToPrivacyStatement":"false"

}

 

Then we can build the oData request for a long list of Candidate IDs, it is just a metter to copy and paste the piece of code as above and change the candidate ID every time.
This operation can be done using test editor tools, an easy solution will be to automate the creation of the text concatenating thre pieces of text using MS EX Excel as below:

 

temp.png

 

Important Note:

Because of an issue currently is not possible concatenate multiple requests in one single UPSERT, trying this only the first candidate will be processed.

Our developers identified and fixed the problem, and the behaviour will return to normal on b1802 Release (internal reference: RCM-43241)

Keywords

delete candidates oDATA DPCS 2.0 , KBA , LOD-SF-RCM-API , Webservices & APIs , How To

Product

SAP SuccessFactors HCM Core 1605