Provisioning Completed Workflow - Get Array Size

We are using the Provisioning Completed Event Trigger to send notifications based certain birthright roles. The source in the trigger is Identity now.

We need to ‘loop’ through the attributeRequests array, check each request and checks each role to determine if notifications should be sent.

When we use attributeRequests[*] as the loop input fails. If we can hard code the object in the are e.g. attributeRequests[0], attributeRequests[1] etc., it works. See below for array example.

How can we get the size/length of the array?
That will help us determine home many times to execute the actions in the loop?


"attributeRequests": [
	{
		"attributeName": "assignedRoles",
		"attributeValue": "ROLE A [cloudRole-1692632990449]",
		"operation": "Add"
             },
            {
                                  "attributeName": "assignedRoles",
	          "attributeValue": "ROLE B [cloudRole-1693682007732]",
                                  "operation": "Add"
	},
                       {
                                  "attributeName": "assignedRoles",
                       "attributeValue": "ROLE C [cloudRole-1693682007732]",
	         "operation": "Add"
	}
    ]

Hi @faye_jacobs1,

We are using the Provisioning Completed Event Trigger to send notifications based certain birthright roles.

We need to ‘loop’ through the attributeRequests array, check each request and checks each role to determine if notifications should be sent.

Have you tried using the JSONPath expression filter in the Provisioning Completed trigger? This might eliminate the need for a loop.

If we filter for certain roles we still don’t know the size.
To provide more detail…all the roles we want to send an email when provisioned start with he same prefix. So it may be one or more than one.

I was able to get the length of the assigned roles with the following Defined Variable assignment $.accountRequests[?(@.accountOperation == ‘Modify’)].attributeRequests.length(). Next step is to loop through each assigned role checking for the name of the role and what operation is being done on each role.

image

1 Like

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