SAP Knowledge Base Article - Public

3527658 - How to update mfield values in the Requisition via ODATA API - Recruiting Management

Symptom

This article describes how to update the mfield values in the requisition via ODATA API.

"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 Recruiting Management 

Resolution

In the following sample, the values for mfield1 will be updated or populated in the UI.

<field-definition id="mfield1" type="picklist" required="false" custom="false" multiselect="true">
<field-label><![CDATA[Job Location (country)]]></field-label>
<field-label lang="de_DE"><![CDATA[Arbeitsstandort (Land)]]></field-label>
<field-label lang="en_US"><![CDATA[Job Location (country)]]></field-label>
  <picklist-id>postingCountry</picklist-id>
</field-definition>

POST: https://endpoint/odata/v2/upsert

The endpoint URL depends on the instance's data center -  KBA 2215682.

REQUEST (JSON):
 
{
"__metadata": {

"uri": "JobRequisition(1495L)",
"type": "SFOData.JobRequisition"
 
},
 
"mfield1":
 
[{
"__metadata": {
  "uri": "PicklistOption(4372L)",    
  "type": "SFOData.PicklistOption"
}},
 
{
"__metadata": {
  "uri": "PicklistOption(4371L)",    
  "type": "SFOData.PicklistOption"

}}]
}
RESPONSE:
 
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <entry>
        <content type="application/xml">
            <m:properties>
                <d:key m:null="true"></d:key>
                <d:status>OK</d:status>
                <d:editStatus>UPDATED</d:editStatus>
                <d:message>Job Requisition has been updated successfully</d:message>
                <d:index m:type="Edm.Int32">0</d:index>
                <d:httpCode m:type="Edm.Int32">204</d:httpCode>
                <d:inlineResults m:type="Bag(SFOData.UpsertResult)"></d:inlineResults>
            </m:properties>
        </content>
    </entry>
</feed>

Breakdown:

a. Job Requisition ID details: 1495L refers to the jobReqId + L.

"__metadata": {
"uri": "JobRequisition(1495L)",
"type": "SFOData.JobRequisition"
}

b. mfield details: The field is mfield1 (same field ID in the job requisition template, Admin Center > Internal and External Search Settings, and ODATA API data dictionary). While  "uri": "PicklistOption(4372L)" and  "uri": "PicklistOption(4371L)", are refers to the picklist option IDs of the values we are passing to the UI, i.e., option Id + L. See image below.

"mfield1":
 
[{
"__metadata": {
  "uri": "PicklistOption(4372L)",    
  "type": "SFOData.PicklistOption"
}},
 
{
"__metadata": {
  "uri": "PicklistOption(4371L)",    
  "type": "SFOData.PicklistOption"
}}]
 
Note: Take note of the square brackets [] and the curly braces {} used for the payload. Missing brackets can cause errors on your request. 
 
Notes: 
 
a. Passing single or multiple values to mfields is supported.
b. Setting or upserting the primary value or querying the primary value is not supported.
c. The primary value in the UI defaults to whichever is on the top entry amongst the selected values in the list. In this sample, the top most selected entry is Tunisia so it becomes the primary.
d. Passing child values for cascading mfields is not supported.
e. using Integration Centre the tool does not allow to update multiple value for the same field, this is a limitation of Integration Centre
 
These are the changes in the mfield values reflected in the requisition.
 

See Also

2950969 - Is it possible to pull the primary value from an mfield via OData API - Recruiting Management

Keywords

update via API, mfield, cascading picklists, primary value, job requisition, job req, RCM, Recruiting Management, 2H2024, RCM-127737 , KBA , LOD-SF-RCM-JOB , Job Postings & Requisitions , Product Enhancement

Product

SAP SuccessFactors HCM Suite all versions ; SAP SuccessFactors Recruiting all versions