Hello everyone I’m building a costum request for others trough a workflow. In this costum request for others the user is able to choose to request a fixed number of role or access profile, for example he can request 3 roles or 2 roles. After that he must select for each role a sunset date. After that I have to built an access request sending it trough API. I’m having troubles on this last point that I’m trying to realize trough a loop:
The variable i’m looping on is the role array, because it could be 1 or more:
The HTTP request inside the loop is the Submit request (tenant/v3/access-requests). In the request body I’m currently putting this JSON:
{
"requestType": "GRANT_ACCESS",
"requestedBy": [
"{{$.trigger.launchedBy.id}}"
],
"requestedFor": [
"{{$.interactiveForm6.formData.requestForOthers}}"
],
"requestedItems": [
{
"comment": " ",
"id": "{{$.loop.loopInput}}",
"removeDate": "{{$.interactiveForm4.formData.getIndex($.interactiveForm1.formData.selectRole.getIndex($.loop.loopInput))}}",
"type": "ROLE"
}
]
}
- In which
{{$.trigger.launchedBy.id}}
is who is launching the interactive process trough the launchpad. "{{$.interactiveForm6.formData.requestForOthers}}"
is the recipient of the request.{{$.loop.loopInput}}
contains the actual id of the access item to request.- {{$.interactiveForm4.formData.getIndex($.interactiveForm1.formData.selectRole.getIndex($.loop.loopInput))}} is the sunset date for that specific access item that i’m considering in the loop.
When launching the workflow I retrieve this problem inside the loop:
{
"loopOutput": {
"failureItems": [
{
"errorMessage": "task failed: activity error (type: sp:external:http:v2, scheduledEventID: 5, startedEventID: 6, identity: 1@sp-workflow-worker-stg-eu-central-1-5cffff5b96-58hml@sp-workflow-engine): request failed (type: HTTP Response Returned a Client Error, retryable: false): request failed: 400 - 400 Bad Request - {\"detailCode\":\"400.0 Bad request syntax\",\"trackingId\":\"e7bf4113b7d04238ace967330d2e66c8\",\"messages\":[{\"locale\":\"en-US\",\"localeOrigin\":\"DEFAULT\",\"text\":\"The request could not be parsed.\"},{\"locale\":\"und\",\"localeOrigin\":\"REQUEST\",\"text\":\"The request could not be parsed.\"}],\"causes\":[]}",
"payload": null
}
],
"successfulItems": []
}
}
I think I’m having problem in the last point . The problem is that I can’t use two innested loop , so I’m traying to craffing for each access item an access request and each access item must have a sunset date, so I’m trying to extract the sunset date from the sunset date array using the getIndex on the access item array passing the actual access item on the getIndex of the current accessItem. Someone that is experienced with workflow and this kind of function can help me?