SAP Knowledge Base Article - Public

2481513 - 'Required field with index 0' error while UPSERT operation - Recruiting Management

Symptom

When performing the UPSERT operation to update a field, getting required field error in the response:

<m:properties>

<d:key m:null="true"></d:key>

<d:status>ERROR</d:status>

<d:editStatus m:null="true"></d:editStatus>

<d:message>date1 required, date2 required, country required, for templateId 123, with the index 0</d:message>

<d:index m:type="Edm.Int32">0</d:index>

<d:httpCode m:type="Edm.Int32">500</d:httpCode>

<d:inlineResults m:type="Bag(SFOData.UpsertResult)"></d:inlineResults>

</m:properties>

Environment

SAP SuccessFactors Recruiting Management

Reproducing the Issue

You are performing a upsert operation to update single field 'Id' of the application. This is just an example.

  1. Use a method to perform upsert operation (e.g. POSTMAN)
  2. Insert the url: https://api(DATA CENTER).successfactors.com/odata/v2/upsert (this url should be based on your instance data center)
  3. Provide API username and password
  4. Insert the values you wish to update
  5. Receive the error message: FieldID is required [...], with the index 0

Cause

For entities JobApplication and Candidate (please note that this refers to the Candidate entity, not CandidateLight), it's required to pass all the information of all required fields.

Resolution

When we are using upsert operation, it is required/mandatory to pass value/data for all the required fields of the template even if we just want to update a single field.

In the JobApplication and Candidate entities, there is no way to bypass the required information as we can do with JobRequisition's isDraft option. However, it is possible, for Candidate Profiles, to bypass the required fields by using, instead, the CandidateLight entity. More details about this functionality can be found here: 2569249 - How to insert a candidate without providing all the required basic fields Odata - RCM.

See Also

2569249 - How to insert a candidate without providing all the required basic fields Odata - RCM

Keywords

OData API, Upsert operation, Upsert, Required field with index error, candidate, application, jobapplication, candidatelight. , KBA , LOD-SF-RCM-API , Webservices & APIs , Problem

Product

SAP SuccessFactors Recruiting all versions