SAP Knowledge Base Article - Public

2749494 - How To do UPSERT with Processing Parameter "Full Purge" (purgeType=full) on ODATA API "PerEmail" via REST client (e.g. POSTMAN) ?

Symptom

"Full Purge" is a Processing Parameter for Upsert. The existing record for the employee is deleted when this upsert operation is performed. A new record is then created with the data specified in the payload.

Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.

Environment

SAP SuccessFactors OData API

Resolution

Few scenarios will be discussed here which will help you to understand the behaviour of "PerEmail" entity UPSERT with "Full Purge" option. You can customize your own scenario as per your business requirement.

Scenario 1:

personIdExternal='akoelemij'

You have below data in the System (User Interface -> Contact Information -> Email Information) -

>> Only one Email Address : anna@abc.com [ Is Primary = True, Email Type : 17161 (Business) ]

1.PNG

Now, via API UPSERT, we will add anna@sap.com as Primary Email ID of Business Type and Make anna@abc.com as Non-Primary Email ID of Personal Type.

Request would look like below:

https://apisalesdemo4.successfactors.com:443/odata/v2/upsert?$format=json&purgeType=Full

Request Payload:

[{"__metadata":{"uri":"PerEmail(emailType='17161', personIdExternal='akoelemij')"},"emailType":"17161","personIdExternal":"akoelemij","emailAddress":"anna@sap.com","isPrimary":true},{"__metadata": {"uri":"PerEmail(emailType='5850', personIdExternal='akoelemij')"},"emailType":"5850","personIdExternal":"akoelemij","emailAddress":"anna@abc.com","isPrimary":false}]

 

After the Upsert:

 

anna@sap.com has been added as Primary Email ID of Business Type and anna@abc.com has been made Non-Primary Email ID of Personal Type.

2.PNG

 

Scenario 2:

personIdExternal='akoelemij'

You have below data in the System (User Interface -> Contact Information -> Email Information) -

>> Only one Email Address: anna@ao.com where "is Primary" = True

3.PNG

Now, we will change this primary email address to anna@sap.com for this user via API UPSERT.

Request would look like below:

https://apisalesdemo4.successfactors.com:443/odata/v2/upsert?$format=json&purgeType=Full

Request Payload:

[{"__metadata":{"uri":"PerEmail(emailType='17161', personIdExternal='akoelemij')"},"emailType":"17161","personIdExternal":"akoelemij","emailAddress":"anna@sap.com","isPrimary":true}]

After the UPSERT:

Email Address for User "akoelemij" will be changed to anna@sap.com for Email Type 17161.

4.PNG

Scenario 3:

personIdExternal='akoelemij'

You have below data in the System (User Interface -> Contact Information -> Email Information) -

>> anna@abc.com is Primary Email Address and anna@sap.com is Non-Primary Email Address

5.PNG

Now, via API Upsert we will swap these Primary Statuses.

Request would look like below:

https://apisalesdemo4.successfactors.com:443/odata/v2/upsert?$format=json&purgeType=Full

Request Payload:

[{"__metadata":{"uri":"PerEmail(emailType='17161', personIdExternal='akoelemij')"},"emailType":"17161","personIdExternal":"akoelemij","emailAddress":"anna@abc.com","isPrimary":false},{"__metadata": {"uri":"PerEmail(emailType='5850', personIdExternal='akoelemij')"},"emailType":"5850","personIdExternal":"akoelemij","emailAddress":"anna@sap.com","isPrimary":true}]

After the UPSERT:

anna@abc.com has become Non- Primary Email Address and anna@sap.com has become Primary Email Address.

6.PNG

See Also

https://help.sap.com/viewer/b2b06831c2cb4d5facd1dfde49a7aab5/latest/en-US/90c1a14790ae424284c3f94cbac5284f.html

Keywords

purgeType=full, PerEmail, ODATA, UPSERT, Full Purge, SuccessFactors, API, How to , KBA , LOD-SF-INT-ODATA , OData API Framework , LOD-SF-INT , Integrations , How To

Product

SAP SuccessFactors HXM Suite all versions