Do you already have an SAP SuccessFactors Work Zone instance but want to create something of your own, beyond the standard UI Integration Cards provided?
Do you wish to add MDF to SuccessFactors and interact with it in Work Zone?
Here is quick tutorial for you to start Custom UI Integration Card development.
SAP SuccessFactors Work Zone provides bunch of out-of-box UI Integration Cards such as My Profile and Org Chart, allowing us to easily access SuccessFactors employee data in Work Zone.
However, if you want to develop custom UI integration cards which pull data from SuccessFactors by yourself, this post can be a valuable resource.
Through this post, I will share step by step guide from the beginning on how to develop a custom Work Zone UI Integration Card which consumes the SuccessFactors data via ODATA API.
As a result of this post, you can use the following custom UI Integration Card in Work Zone.
Custom UI Integration Card – My Badge
Before we begin, there are a few prerequisites
Let’s briefly understand the technologies mentioned in the prerequisites:
SAP SuccessFactors Work Zone
Let’s go ahead and develop a UI Integration Card.
As an example, in this article, I will develop UI Integration card to pull employee’s Badge data from SuccessFactors.
First, let’s prepare the necessary environment for development.
Create Dev Space
It may take some time for the Dev Space to be created.
Once completed, its status will change to “RUNNING.” Click on the Dev Space to start your development environment.
Now, let’s create a project for Work Zone UI Integration Card development.
Create UI Integration Card Project
Once the UI Integration Card project is created, you can browse the project files in the left Explorer area. Right-click on the Manifest.json file and select “UI Integration Card: Preview” to get a preview of the card’s appearance.
Preview UI Integration Card
To craft Work Zone UI Integration card which pull SuccessFactors Badge data,
replace the manifest.json
in the project root with the code below.
{
"_version": "1.15.0",
"sap.app": {
"id": "ns.UIIntegrationCard",
"type": "card",
"title": "My Badges",
"subTitle": "Badges I received",
"applicationVersion": {
"version": "1.0.0"
}
},
"sap.ui": {
"technology": "UI5",
"deviceTypes": {"desktop": true, "phone": true, "tablet": true},
"icons": {
"icon": "sap-icon://badge"
}
},
"sap.card": {
"type": "List",
"configuration": {
"destinations": {
"SFSFDestination": {
"name": "SuccessFactors_API"
}
},
"parameters": {
"currentLoginBizxUserID": {
"value": "{context>sap.successfactors/currentUser/id/value}",
"type": "string",
"visible": false
},
"SFCompanyID": {
"value": "{context>sap.successfactors/currentCompany/id/value}",
"type": "string",
"visible": false
},
"maxItems": {
"value": 15
},
"locale": {
"value": "{{parameters.LOCALE}}",
"type": "string",
"visible": false
}
}
},
"header": {
"title": "My Badge",
"subTitle": "Badges I received",
"icon": {
"src": "sap-icon://badge",
"visible": true
},
"status": {
"text": "Top {{parameters.maxItems}}"
}
},
"content": {
"data": {
"request": {
"url": "{{destinations.SFSFDestination}}/odata/v2/UserBadges",
"method": "GET",
"parameters": {
"$format": "JSON"
},
"headers": {
"successfactors-employment-id": "{{parameters.currentLoginBizxUserID}}"
},
"withCredentials": true
},
"path": "/d/results"
},
"maxItems": 5,
"item": {
"title": "{badgeTitle}",
"description": "{comment}",
"icon": {
"src": "data:image/bmp;base64,{photo}",
"visible": "{Visible}"
},
"info": {
"value": "{badgeCreatorName}",
"state": "Information"
}
}
}
}
}
UI Integration Card creation is now complete!
Before deploying it to Work Zone, let’s explore the meaning of the source code.
The “sap.card” property defines the appearance, parameters, data source, and field mapping of the UI Integration Card.
Key properties of “sap.card”:
Let’s deploy the developed Card to Work Zone. There are two deployment options:
The first option is to directly deploy the developed UI Integration Card to SAP SuccessFactors Work Zone. To perform a direct deployment, SAP Business Application Studio and SAP SuccessFactors Work Zone must exist in the same SAP BTP Subaccount.
The second option involves packaging the developed UI Integration Card, downloading it, and then uploading it to SAP SuccessFactors Work Zone for application. This method doesn’t require Work Zone and Business Application Studio to be in the same Subaccount.
In this post, we will deploy the Card using the second method.
Right-click on the “manifest.json” file and select “UI Integration Card: Package.”
A ZIP file with the namespace and project name will be generated.
UI Integration Card : Package
Right-click on the generated ZIP file and select “Download” to save the file to your local PC. This file needs to be uploaded to your Work Zone instance.
Download UI Integration Card Package
Access to SAP SuccessFactors Work Zone with administrator permission and follow the steps below to upload the UI Integration Card:
Once upload is done, you can find your Badge Card on the uploaded cards section.
Enable the card
We now need to enable users to use the Badge card on the page. When you toggle the switch button for the card, the card becomes enabled.
If you click the Configure button, you can change the values for Destination and Max Item as per the settings in the ‘manifest.json’ file.
(If you followed the SAP SuccessFactors Work Zone Initial Setup process, you can use SuccessFactors_API destination as the default.)
Now, let’s try adding the My Badge card to the page.
Follow the steps below after accessing SAP SuccessFactors Work Zone:
My Badge Card on Home page
Once it is completed, employees will be able to check their SuccessFactors Badges every time they access the Work Zone home page, and they will also be able to immediately verify it in the Work Zone whenever they receive a badge from other employees in SuccessFactors.
That’s it for today’s tutorial!
I hope this post has been of some help to those of you reading it, and if you encounter any stumbling blocks along the way, please leave a comment!