Performance form custom element update from User entity via OData API upsert in CPI

Estimated read time 13 min read

Introduction:

Performance evaluation and performance management entail multiple steps for an employee within SuccessFactors. Beginning with Assessment, Signature, and Completion, the form template progresses through various evaluation stages for employees. The performance form template is configured to extract employee data such as LastName, FirstName, Department, Division, HireDate, Business Title, etc. While some information suffices for performance evaluation, for larger companies, considering additional details is crucial, which may not be directly fetched from the form template or available within its general settings.

In such cases, custom sections within the form templates are utilized to incorporate the necessary data. This is achieved through custom elements sections nested under custom sections in the Performance Review Template.

In this blog, we will delve into the steps to create custom elements in the Performance Review Template and allocate the requisite field permissions to facilitate its integration via the OData API, utilizing CPI as middleware.

Objective:

The purpose of this blog is to illustrate the necessary steps for creating and updating custom field sections in performance forms and templates, which cannot be done via basic upsert or user sync jobs in the Integration Center. To address this, automation and updates through CPI can be an ideal approach for updating custom sections. The custom field section in performance forms consists of user-created objects, allowing for the input of any desired values during the completion of an employee’s performance form.

In our scenario, we assume there is data requiring updates from the User Entity to the custom Element form section. While manual updating is feasible in small-scale scenarios, it becomes exceedingly challenging for a significant number of employees. Therefore, automation is essential to facilitate data transition from User MDF to CustomFormSection.

To accomplish this, CPI serves as a middleware to import the data and facilitate updates to the CustomFormSection. The image below illustrates the one-to-one mapping, demonstrating how CPI replicates values between these two entities.

Fig 1: Demonstration of fields that need to be moved from User MDF to CustomFormSection in FormContent

Implementation:

The below architecture diagram shows the complete expectation and execution of the CPI job. The left-hand section is the query section which are the calls that CPI made to get the current data from FormContent (All performance form data of an employee) and the existing data in User MDF custom fields.

The right-hand section shows the upsert operation performed by the CPI job. If any custom field data exists for the employee, then it gets replicated into the custom fields section by using the entity FormCustomSection to upsert all custom elements at once. (The screenshot for the same upsert is shown later down the blog).

The CPI job can be scheduled so that all the delta changes or new forms’ custom sections can get updated with the relevant data.

Fig 2: Architecture for FormCustomSection update from User MDF via CPI

 

For the custom elements permission setting navigate to Admin Center/Manage Templates/<Choose your template name> in SuccessFactors, under the custom field and section the custom elements are created as follows,

Fig 3: Custom Elements created for the custom section.

 

For the section field permission select Type: Write and All for other API roles, this is shown below for example.

Fig 4: Field Permission setting for Custom Fields created under the custom section.

 The section permission field can also be defined so that the API user can update it only when this gets launched in the inbox, and it is at step LAUNCH.

Fig 5: Custom Section Permission settings

 

The newly created custom section will look somewhat like as shown below, and the values will be populated from User Entity (for ex. customString1 … 5) via CPI.

Fig 6: Custom Section in Performance Form

To get and update the values related to each Form we will query the Entity FormContent from the SuccessFactors ODATA V2 API adaptor, see the screenshot below for reference. The FilterFormContent includes the formTemplate Id and lastModifiedDateTime string as this is dynamically set in each execution.

Fig 7: Odata API call to FormContent

 

After getting data from FormContent the same payload can be used to get User value, by navigating to FormContent/formHeader/FormHeader/formSubject/User/custom01 … custom05 the custom values can be extracted, and the payload can be prepared to update the customFormElement for each custom Elements created in the above steps.

To upsert the custom element the Upsert (POST) is used where the entity can be selected as FormCustomSection, this entity can be directly used to update all your custom elements all at once,

Fig 8: OData API for Upsert FormCustomSection

 

The payload FormCustomSection is prepared from FormContent and the payload is attached below to refer,

 

 

<FormCustomSection>
<FormCustomSection>
<sectionIndex>1</sectionIndex>
<formContentId>6916</formContentId>
<formDataId>4352</formDataId>
<customElement>
<FormCustomElement>
<elementKey>ele_1</elementKey>
<sectionIndex>1</sectionIndex>
<itemId>-1</itemId>
<formContentId>6916</formContentId>
<formDataId>4352</formDataId>
<valueKey>wf_sect_1_e_ele_10</valueKey>
<value>custom string 1</value>
</FormCustomElement>
<FormCustomElement>
<elementKey>ele_2</elementKey>
<sectionIndex>1</sectionIndex>
<itemId>-1</itemId>
<formContentId>6916</formContentId>
<formDataId>4352</formDataId>
<valueKey>wf_sect_1_e_ele_21</valueKey>
<value>custom string 2</value>
</FormCustomElement>
<FormCustomElement>
<elementKey>ele_5</elementKey>
<sectionIndex>1</sectionIndex>
<itemId>-1</itemId>
<formContentId>6916</formContentId>
<formDataId>4352</formDataId>
<valueKey>wf_sect_1_e_ele_52</valueKey>
<value>custom string 3</value>
</FormCustomElement>
<FormCustomElement>
<elementKey>ele_3</elementKey>
<sectionIndex>1</sectionIndex>
<itemId>-1</itemId>
<formContentId>6916</formContentId>
<formDataId>4352</formDataId>
<valueKey>wf_sect_1_e_ele_33</valueKey>
<value>custom string 4</value>
</FormCustomElement>
<FormCustomElement>
<elementKey>ele_4</elementKey>
<sectionIndex>1</sectionIndex>
<itemId>-1</itemId>
<formContentId>6916</formContentId>
<formDataId>4352</formDataId>
<valueKey>wf_sect_1_e_ele_44</valueKey>
<value>custom string 5</value>
</FormCustomElement>
</customElement>
</FormCustomSection>
</FormCustomSection>

 

 

 

As per the definition of FormCustomElement the elementKey, valueKey forms the unique to update a particular customElement, and combining formDataId and formContentId forms the unique value to update the customElement only for a particular employee. The above payload upsert will respond to successful upsert for elementKey, valueKey formDataId, and formContentId as a key pair.

The mapping for the above payload can be shown below to understand the field’s association for each custom element with the payload after the upsert.

Fig 9: Output mapping of each custom element

 Conclusion:

Thus, the custom Form section can be created and automated easily, which can be updated in a delta run from CPI. Custom section upsert enables the Route map to complete the initial launch step by itself thus eliminating the manual update of data within the form. This can be extended to re-route the form by itself by using RouteMap API. Custom Form sections add more value to Performance forms as they enable more insights for an employee to be passed down for performance evaluation. Thus, using FormCustomSection or customElement API upsert is useful to perform and set up the automation task.

 

​ Introduction:Performance evaluation and performance management entail multiple steps for an employee within SuccessFactors. Beginning with Assessment, Signature, and Completion, the form template progresses through various evaluation stages for employees. The performance form template is configured to extract employee data such as LastName, FirstName, Department, Division, HireDate, Business Title, etc. While some information suffices for performance evaluation, for larger companies, considering additional details is crucial, which may not be directly fetched from the form template or available within its general settings.In such cases, custom sections within the form templates are utilized to incorporate the necessary data. This is achieved through custom elements sections nested under custom sections in the Performance Review Template.In this blog, we will delve into the steps to create custom elements in the Performance Review Template and allocate the requisite field permissions to facilitate its integration via the OData API, utilizing CPI as middleware.Objective:The purpose of this blog is to illustrate the necessary steps for creating and updating custom field sections in performance forms and templates, which cannot be done via basic upsert or user sync jobs in the Integration Center. To address this, automation and updates through CPI can be an ideal approach for updating custom sections. The custom field section in performance forms consists of user-created objects, allowing for the input of any desired values during the completion of an employee’s performance form.In our scenario, we assume there is data requiring updates from the User Entity to the custom Element form section. While manual updating is feasible in small-scale scenarios, it becomes exceedingly challenging for a significant number of employees. Therefore, automation is essential to facilitate data transition from User MDF to CustomFormSection.To accomplish this, CPI serves as a middleware to import the data and facilitate updates to the CustomFormSection. The image below illustrates the one-to-one mapping, demonstrating how CPI replicates values between these two entities.Fig 1: Demonstration of fields that need to be moved from User MDF to CustomFormSection in FormContentImplementation:The below architecture diagram shows the complete expectation and execution of the CPI job. The left-hand section is the query section which are the calls that CPI made to get the current data from FormContent (All performance form data of an employee) and the existing data in User MDF custom fields.The right-hand section shows the upsert operation performed by the CPI job. If any custom field data exists for the employee, then it gets replicated into the custom fields section by using the entity FormCustomSection to upsert all custom elements at once. (The screenshot for the same upsert is shown later down the blog).The CPI job can be scheduled so that all the delta changes or new forms’ custom sections can get updated with the relevant data.Fig 2: Architecture for FormCustomSection update from User MDF via CPI For the custom elements permission setting navigate to Admin Center/Manage Templates/<Choose your template name> in SuccessFactors, under the custom field and section the custom elements are created as follows,Fig 3: Custom Elements created for the custom section. For the section field permission select Type: Write and All for other API roles, this is shown below for example.Fig 4: Field Permission setting for Custom Fields created under the custom section. The section permission field can also be defined so that the API user can update it only when this gets launched in the inbox, and it is at step LAUNCH.Fig 5: Custom Section Permission settings The newly created custom section will look somewhat like as shown below, and the values will be populated from User Entity (for ex. customString1 … 5) via CPI.Fig 6: Custom Section in Performance FormTo get and update the values related to each Form we will query the Entity FormContent from the SuccessFactors ODATA V2 API adaptor, see the screenshot below for reference. The FilterFormContent includes the formTemplate Id and lastModifiedDateTime string as this is dynamically set in each execution.Fig 7: Odata API call to FormContent After getting data from FormContent the same payload can be used to get User value, by navigating to FormContent/formHeader/FormHeader/formSubject/User/custom01 … custom05 the custom values can be extracted, and the payload can be prepared to update the customFormElement for each custom Elements created in the above steps.To upsert the custom element the Upsert (POST) is used where the entity can be selected as FormCustomSection, this entity can be directly used to update all your custom elements all at once,Fig 8: OData API for Upsert FormCustomSection The payload FormCustomSection is prepared from FormContent and the payload is attached below to refer,  <FormCustomSection>
<FormCustomSection>
<sectionIndex>1</sectionIndex>
<formContentId>6916</formContentId>
<formDataId>4352</formDataId>
<customElement>
<FormCustomElement>
<elementKey>ele_1</elementKey>
<sectionIndex>1</sectionIndex>
<itemId>-1</itemId>
<formContentId>6916</formContentId>
<formDataId>4352</formDataId>
<valueKey>wf_sect_1_e_ele_10</valueKey>
<value>custom string 1</value>
</FormCustomElement>
<FormCustomElement>
<elementKey>ele_2</elementKey>
<sectionIndex>1</sectionIndex>
<itemId>-1</itemId>
<formContentId>6916</formContentId>
<formDataId>4352</formDataId>
<valueKey>wf_sect_1_e_ele_21</valueKey>
<value>custom string 2</value>
</FormCustomElement>
<FormCustomElement>
<elementKey>ele_5</elementKey>
<sectionIndex>1</sectionIndex>
<itemId>-1</itemId>
<formContentId>6916</formContentId>
<formDataId>4352</formDataId>
<valueKey>wf_sect_1_e_ele_52</valueKey>
<value>custom string 3</value>
</FormCustomElement>
<FormCustomElement>
<elementKey>ele_3</elementKey>
<sectionIndex>1</sectionIndex>
<itemId>-1</itemId>
<formContentId>6916</formContentId>
<formDataId>4352</formDataId>
<valueKey>wf_sect_1_e_ele_33</valueKey>
<value>custom string 4</value>
</FormCustomElement>
<FormCustomElement>
<elementKey>ele_4</elementKey>
<sectionIndex>1</sectionIndex>
<itemId>-1</itemId>
<formContentId>6916</formContentId>
<formDataId>4352</formDataId>
<valueKey>wf_sect_1_e_ele_44</valueKey>
<value>custom string 5</value>
</FormCustomElement>
</customElement>
</FormCustomSection>
</FormCustomSection>   As per the definition of FormCustomElement the elementKey, valueKey forms the unique to update a particular customElement, and combining formDataId and formContentId forms the unique value to update the customElement only for a particular employee. The above payload upsert will respond to successful upsert for elementKey, valueKey formDataId, and formContentId as a key pair.The mapping for the above payload can be shown below to understand the field’s association for each custom element with the payload after the upsert.Fig 9: Output mapping of each custom element Conclusion:Thus, the custom Form section can be created and automated easily, which can be updated in a delta run from CPI. Custom section upsert enables the Route map to complete the initial launch step by itself thus eliminating the manual update of data within the form. This can be extended to re-route the form by itself by using RouteMap API. Custom Form sections add more value to Performance forms as they enable more insights for an employee to be passed down for performance evaluation. Thus, using FormCustomSection or customElement API upsert is useful to perform and set up the automation task.   Read More Technology Blogs by Members articles 

#SAP

#SAPTechnologyblog

You May Also Like

More From Author

+ There are no comments

Add yours