Skip to Content
Technical Articles
Author's profile photo Deepak MP

How to Perform Upsert Operation using CPI Successfactors Soap Adapter

About the Author:

I work as a Developer in Cloud Platform Integration and work predominantly in building and maintaining CPI adapters. Adapters are used to integrate systems with different platform. I specialize in CPI Successfactors Adapter, which is used to integrate systems with Successfactors.

Why This Article:

One common mistake that user does is to copy the payload template from Soap UI and use it as a payload in Successfactors CPI adapter.

Successfactors CPI adapter takes simple xml as payload and the adapter will take care of creating the Soap Envelope around the payload before sending the data to Successfactors system.

We will explain it step by step with a simple example.

What to expect in this article:

In this article, we will explain how an Upsert operation is performed using Successfactors CPI Adapter.

 

Scenario: Update records of user with empid 1001

  • Create an Integration Project

We use Content Modifier to pass payload to Successfactors CPI adapter and SFTP adapter to get the response from the Upsert operation from the Successfactors CPI adapter. Adding SFTP adapter is optional, it can be replaced with any other adapter of your choice and you may also choose not to use any adapter if the response from the adapter is not required.

  • Model Upsert Operation in Successfactors CPI Adapter.

In the Successfactors “Processing” tab enter the Successfactors Address and Credential Name and click on “Select”.

Model operation requires you to connect to the Successfactors system. Enter the Successfactors connection details and click on Connect.

In the Entity Selection dialog select the table that needs to be updated. In our scenario we are updating User table.

Select Operation as “Upsert” and select the fields that needs to be updated. externalId and Status are mandatory fields. Click on Finish.

 

  • Add the payload to the Content Modifier.

The sample payload is given below.

<?xml version="1.0" encoding="UTF-8"?>
<Users>
   <User>
	<department>Talent Management</department>
	<division>Industries</division>
	<email>eee@successfactors.com</email>
	<empId>1001</empId>
	<externalId>aaaa</externalId>
	<firstName>Alex</firstName>
	<hrId>USR-17</hrId>
	<jobCode>Human Resources Manager (HR-MGR)</jobCode>
	<lastName>eee</lastName>
	<location>San Mateo (US_SFO)</location>
	<status>active</status>
	<timeZone>CST</timeZone>
	<username>Hello13</username>
    </User>
</Users>

Add the payload for the selected fields as shown. The payload should be a simple xml.

Save the changes and deploy the iflow.

Conclusion:

In this article we explained how Upsert operation can be performed using CPI Successfactors Soap Adapter. You can now go ahead and try out few scenario.

Assigned tags

      2 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Terrence Chamburuka
      Terrence Chamburuka

      Thank you for the stuff can you help with using Upsert of the ODATA API

      Author's profile photo JOSE FRANCISCO ARANDA AGUIRRE
      JOSE FRANCISCO ARANDA AGUIRRE

      Hello, thanks for you post, I have a question, performing an perEmail upsert of many users I get an error if any row failing:

      <data contentType="null" contentLength="537"><![CDATA[{error text :
      An exception has occurred. These are the details..
      UPSERT operation status; Job Status:{ERROR}, Message:{}
      UPSERT operation FAILED; Total:3, Successful:2, Failed:1, Not Processed:0
      Index:{0}, Edit Status:{UPSERTED}, Error Status:{OK}, Message:{}
      Index:{1}, Edit Status:{NOEDIT}, Error Status:{ERROR}, Message:{Global Person ID is invalid.,
      failed record info: {email_address=bbbbhotmail.com, email_type=3964, person_id_external=bbsbb, isPrimary=true}}
      Index:{2}, Edit Status:{UPSERTED}, Error Status:{OK}, Message:{}

      Is there any way to continue execution and obtain respond operation on body flow with the ox and error execution on respond operation?. like this (manual edited xml, just to represent what I want):

       

      <upsertResponse xmlns="urn:sfobject.sfapi.successfactors.com"
      xmlns:ns2="urn:fault.sfapi.successfactors.com">
      <result>
      <jobStatus>ERROR</jobStatus>
      <message/>
      <objectEditResult>
      <errorStatus>OK</errorStatus>
      <editStatus>UPSERTED</editStatus>
      <index>0</index>
      <message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:nil="true"/>
      </objectEditResult>
      <objectEditResult>
      <errorStatus>OK</errorStatus>
      <editStatus>UPSERTED</editStatus>
      <index>1</index>
      <message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:nil="true"/>
      </objectEditResult>
      <objectEditResult>
      <errorStatus>ERROR</errorStatus>
      <editStatus>NOEDIT</editStatus>
      <index>2</index>
      <message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:nil="true"/>
      </objectEditResult>
      </result>
      </upsertResponse>

      Regards

      César