Symptom
Is it possible to use Odata API to upload an attachment directly to a specific PM form?
Environment
SAP SuccessFactors Performance Management
Reproducing the Issue
Below is a standard way to upload a single attachment to the PM domain.
Note: File content is required. The default size limit is 5M. In the payload, the file content is displayed as a base64-encoded string.
Request:
Operation | Insert |
HTTP Method | POST |
URI | https://<API-Server>/odata/v2/Attachment |
Payload |
{
"__metadata": { "uri": "Attachment" }, "userId": "cgrant", "fileName": "f1.jpg", "description": "des1", "fileContent": "ZHV6aWVsZQ==", "viewable": true, "deletable": false, "moduleCategory": "PERFORMANCE_ASSESSMENTS", "module": "PERFORMANCE_MANAGER" |
Response:
{
"d": {
"__metadata": {
"uri": "https://<API-Server>/odata/v2/Attachment(8106L)",
"type": "SFOData.Attachment"
},
"userId": "cgrant",
"fileName": "f1.jpg",
"description": "des1",
"fileContent": "ZHV6aWVsZQ==\r\n",
"viewable": true,
"deletable": false,
"moduleCategory": "PERFORMANCE_ASSESSMENTS",
"module": "PERFORMANCE_MANAGER",
"attachmentId": "8106"
}
}
Resolution
By giving values to the module and moduleCategory fields, you can upload an attachment to a specific SAP SuccessFactors domain.
However, when you upload an attachment to Performance Management, it isn’t associated with any forms.
In the above payload, you can notice that there are no properties indicating which form the attachment will be uploaded to. That means you can't use Odata API to upload an attachment directly to a specific Performance Management form.
More reference on how to upload attachments, please check Attachment - SAP SuccessFactors HCM Suite OData API: Reference Guide (V2).
If you want to have this functionality changed, you can submit an enhancement request through our Continuous Influence page, 2090228 - How to Submit Ideas for SAP SuccessFactors Products is attached to guide you.
See Also
- Attachment - SAP SuccessFactors HCM Suite OData API: Reference Guide (V2)
- KB article 2290233 - How to enable Attachments in PM v12 Acceleration - Performance Management
- KB article 2090228 - How to Submit Enhancement Requests for SAP SuccessFactors Products
Keywords
Odata API, attachment, performance management, form, add attachment, upload attachment , KBA , LOD-SF-PM-API , Webservices, OData APIs , Product Enhancement