on ‎2025 Jan 07 8:16 AM
Hi Everyone,
Hope everyone doing fine.
I got requirement from customer to query all pending workflows in SF with all changed data old value and new value, and expecting to do action approve and reject via custom application.
So what we currently do is, we use ToDo V2 entity to get pending workflows where categoryId= '14' and '17' as per reference here
This is how it looks like via posman.
{
"d": {
"results": [
{
"__metadata": {
"uri": "https://api44preview.sapsf.com/odata/v2/WfRequest(918L)",
"type": "SFOData.WfRequest"
},
"wfRequestId": "918",
"lastModifiedDateTime": "/Date(1731983617000+0000)/",
"lastModifiedBy": "61111467",
"module": "HRIS",
"reminderSentDate": null,
"totalSteps": 9,
"createdDateTime": "/Date(1731983617000+0000)/",
"createdOn": "/Date(1731983617000)/",
"url": null,
"lastModifiedOn": "/Date(1731983617000)/",
"parentWfRequestId": null,
"createdBy": "61111467",
"currentStepNum": 1,
"status": "PENDING",
"wfRequestUINav": {
"__deferred": {
"uri": "https://api44preview.sapsf.com/odata/v2/WfRequest(918L)/wfRequestUINav"
}
},
"parentWfRequestNav": {
"__deferred": {
"uri": "https://api44preview.sapsf.com/odata/v2/WfRequest(918L)/parentWfRequestNav"
}
},
"workflowAllowedActionListNav": {
"__deferred": {
"uri": "https://api44preview.sapsf.com/odata/v2/WfRequest(918L)/workflowAllowedActionListNav"
}
},
"empWfRequestNav": {
"__deferred": {
"uri": "https://api44preview.sapsf.com/odata/v2/WfRequest(918L)/empWfRequestNav"
}
},
"wfRequestParticipatorNav": {
"__deferred": {
"uri": "https://api44preview.sapsf.com/odata/v2/WfRequest(918L)/wfRequestParticipatorNav"
}
},
"wfRequestCommentsNav": {
"__deferred": {
"uri": "https://api44preview.sapsf.com/odata/v2/WfRequest(918L)/wfRequestCommentsNav"
}
},
"wfRequestStepNav": {
"__deferred": {
"uri": "https://api44preview.sapsf.com/odata/v2/WfRequest(918L)/wfRequestStepNav"
}
}
}
]
}
}then, we navigate to wfrequestUINav, and it will be look like this.
{
"d": {
"__metadata": {
"uri": "https://api44preview.sapsf.com/odata/v2/WfRequestUIData(918L)",
"type": "SFOData.WfRequestUIData"
},
"wfRequestId": "918",
"businessUnit": null,
"isEffectiveDateType": true,
"isObjectBase": false,
"assigneeUserId": null,
"operateUserName": "MUHAMAD IRFAN TAUFIQ",
"assigneeUserName": null,
"jobTitle": "OPERATOR TP(17100182)",
"legalEntity": null,
"objectType": null,
"division": null,
"receivedOn": null,
"department": null,
"costCenter": null,
"deeplink": "https://hcm-ap20-preview.hr.cloud.sap/sf/hrisworkflowapprovelink?workflowRequestId=V4-0-a1-jeRuUg-UbT1cXjxSysAAPkZFfnfud_mgVo-nr1T1eQ&prevPage=HOME&company=ptpamapersT1&username=SFAPI",
"todoSubjectLine": "MUTASI for ANTONIUS AGUNG TEGUH SURYADI",
"operateType": "Initiated",
"subjectUserId": "61102176",
"changedData": null,
"eventReason": "MUTASI",
"actionType": null,
"isAssigned": false,
"operateUserId": "61111467",
"objectName": null,
"location": "BTSJ",
"actions": "[{\"action\":\"approve\"}]",
"operateDate": "November 19, 2024",
"effectiveDate": "October 1, 2024",
"subjectUserName": "ANTONIUS AGUNG TEGUH SURYADI"
}
}and the client expectation is to get similar changed data old value and new value as picture below which is not populated in wfrequestUIData
So my question is, is this expected behavior? we cannot fetched data via API as picture above? only use deeplink?
Thank you!
Reza Dwi
Request clarification before answering.
Hi,
from API perspective "getWorkflowPendingData" could help.
This shows more or less the things you can see on the UI.
Depending on your use case you can also think about to use iframes to show the workflow request/details in a iframe.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 7 | |
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.