Dynamic roleIds for Create Campaign HTTP Request (Workflow)

Hi all,

I’m trying to create a Role Review Campaign via Workflow using the HTTP Request card.

It works when I hardcode the role IDs:

"roleIds": ["11111111111111111111111111111111", "22222222222222222222222222222222"]

But I want to make this dynamic using the output from the Get Access card, which returns:

[
  { "id": "aaaa1111bbbb2222cccc3333dddd4444", "name": "Business Role 1", "type": "ROLE" },
  { "id": "eeee5555ffff6666gggg7777hhhh8888", "name": "IT Role", "type": "ROLE" }
]

I’ve tried expressions like
{{@toJson(@map($.getAccess.accessItems, it.id))}}
and
{{$.getAccess.accessItems[*].id}},
but the workflow always errors with invalid JSON or parsing issues.

Has anyone managed to dynamically pass an array of role IDs from Get Access into the roleIds field for campaign creation?

Hi Luis,

As far as I understand you are unable to fetch the role id’s with the above script. Could you try with $.accessItems[*].id.

Above script will fetch the map of all role id’s. Use the provided link for the JSON script validation: Json Path Evaluator | SailPoint Developer Community

Also getAccess step returns a maximum of 250 access items.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.