Remove access profile in a workflow

Hi All,

I am working on a workflow to remove the access profile , in which i am HTTP request, with payload inside the loop

{“requestType”:“REVOKE_ACCESS”,“requestedFor”:[“{{$.loop.context.id}}”],“requestedItems”:[{“comment”:“Requesting access “,“id”:”{{$.loop.loopInput.id}}”,“type”:“ACCESS_PROFILE”}]}

but its not working as expected.
is my payload is incorrect?
pls suggest

Hi @nidhipriya

I would need to see what you passed in your loop for inputs as well as the context. This JSON body below has worked for me, but I passed in the following:

My guess without seeing your loop is that you should be calling {{$.loop.loopInput}}instead of {{$.loop.loopInput.id}}

What I passed into the loop:

JSON Body:

{"requestType":"REVOKE_ACCESS","requestedFor":["{{$.loop.context.id}}"],"requestedItems":[{"comment":"Submitted Via Access Removal Form","id":"{{$.loop.loopInput}}","type":"ACCESS_PROFILE"}]}
1 Like

@nidhipriya Why dont you use get Access , Loop,Mange Access Action items instead of HTTP Request simply. Steps–> Identity Attribute change trigger–>Get Access where you can select Access Profile check box –> Loop provide context as $.trigger.identity and input $.getAccess.accessItem[*] –> Manage Access.

Hi @nidhipriya,

Would you mind explaining the complete flow or requirements once? As per my current understanding, I would suggest using Get Access followed by Manage Access, as that might be a better approach.

Hi @nidhipriya ,
Try to use below filter
{“requestType”:“REVOKE_ACCESS”,“requestedFor”:[“{{$.loop.context.id}}”],“requestedItems”:[{“comment”:“Please remove”,“id”:“{{$.loop.loopInput.id}}”,“name”:“{{$.loop.loopInput.name}}”,“type”:“ACCESS_PROFILE”}]}

Also please share what you have passed in the loop input and context.