Hi,
I have some issues in workflow where I try to pass an Array to a body in HTTP Request Action.
It is basically exactly the same issue as in another thread I found which got closed without solution: Workflow - Passing array to "Enter Value" field
In my case it is that I am creating a certification with the HTTP request (instead of the OOTB Certification action due to that is more limited to what it can filter on). In my case I want to certify only Access profiles for a specific Identity and I need to use a certification of type search.
This is the overview of my workflow:
To do this I need to pass in all access profiles ids which the user has which I get from using Get Access. I can see that they are all collected into my variable: {{$.getAccess.accessItems[*].id}} and they are comma separated. But when I use this variable in the enter field value it is entered without the commas, meaning:
[“123”, “152”, “166”] instead becomes [“123” “152” “166”] which is incorrect json. I wouldn’t say it is a bug but it causes issues… Anyone got any suggestion on what to do?
Maybe it’s possible that the commas won’t be excluded if you replace the “Get Access” action with another HTTP Request where you search for the access-profiles via v3/search API.
Well this is for a mover event, and I want to include all accessProfiles which this specific user has, for starters this search will return every single AP that exists in the tenant (bit over kill but works ofc). But not sure anyway that I can use that specific case, or atleast I am uncertain what the query would look like.
This is what I do right now fyi:
If there is another way to do what I am after I am all ears, perhaps I can put your query into the query field where I currently have null and just remove the accessConstraints(?). I simply did what I was after in a search caompaign and then reversed engineered to do the same from the workflow.
The “tags” query is simply so that we can exclude certain birthright access. Even if the query itself returns all APs in the tenant, only the ones that the identity actually has will be included in the certification campaign.
This is a known limitation with inline variables. Objects and arrays do not serialize to proper JSON. Instead, they are serialized as Golang maps/arrays. This is why you see arrays being presented without commas and objects that have the map[] keyword in them when referencing them with inline variables. As of now, only single values, like string, integer, and boolean can be referenced with inline variables. There is a feature request open (PLTWRKFLW-1352) to support objects and arrays.
We have a similar requirement and SailPoint support suggested inline variables. I adapted the sample and we are able to use the string array resulted from Get Access in the HTTP request that successfully creates a certification campaign.
As you can see, the rest of the HTTP body can use regular workflow variables syntax.
Consider that in this example, Get Access only retrieves access profiles. If you would retrieve ALL items then this path $.getAccess.accessItems[*].id needs to be refined.