Symptom
Your need to replace / delete data in field(s), that are currently populated with data in the User entity.
Environment
- SuccessFactors BizX
- OData API
Reproducing the Issue
Your requirement is to replace / delete data in field(s) located in the User entity
Cause
The following parameter needs to be used in the OData API Upsert request: purgeType=record
Resolution
purgeType=record
The purgeType=record parameter allows you to purge existing data of a user record and upsert new data.
For example:
When you upsert a user on the one-to-many navigation properties, the API always performs a merge operation and appends the values to these properties.
With the purgeType=record parameter, you can tell the API to erase existing data and replace them with the ones provided in the request payload.
This allows you to purge user's links and add a new link within one API call.
Syntax for upsert operation: https://<hostname>/odata/v2/upsert?purgeType=record
Taking the field companyExitDate (User) as an example:
- Retrieve the data set that is currently held for the User record that you would like to delete field data from
- Perform an OData Upsert request with the purgeType=record parameter (as shown in the above URL)
- Use the same (current) data set, which is currently contained for this user in the User entity, but leave companyExitDate field empty (or replace with a new value)
- If the field is left blank (or not included in payload) - the field data will be purged upon executing Upsert request
- If the field is populated with new value / data - the field data that is currently held in companyExitDate will be replaced with the new data that is provided in upsert request
Please Note: you must provide all of the current data (that is currently contained for the User) within the Upsert request you are perofrming:
- Alter the data (in the request payload) for fields that you wish to replace current user record
- Remove fields (from request payload) or set to 'null' that you wish to purge from the current user record
See Also
Keywords
User, Delete, Replace, Purge Type, purgeType, record, OData API , KBA , LOD-SF-INT-ODATA , OData API Framework , LOD-SF-INT , Integrations , How To