Iterating Over a List of Objects in IdentityNow

Hi,

I’m trying to iterate over a list that contains objects structured like this:

My goal is to use this list as input for a loop so I can perform operations on each element.

Is this possible within IdentityNow? Are there alternative approaches? Currently, the execution returns an “empty variable,” and I’m not sure why.

Thank you!

Because you have defined Variable A as a text, it is not working as an input to the loop

If its an array, why not use directly in loop?

Is there a way to define it outside of the loop?

I need to keep it out of the loop, because I need some integers to put into the HTTP call

Where these integers comming from ? Can’t you put these integers into the context of the loop, then use them inside for each element ?

Can you provide more details, maybe we can find another way for this to be done ?

I need these integers to be able to iterate over the offset in HTTP calls; each step has a limit of 100 until termination. Is there a way to create an object before the loop and then pass it by context? Because there’s no way to change the offset via the define variable (it doesn’t accept integers from what I can see)

Hello Carmine,

Yes, you can put your offset value in the field « context » in the loop configuration (I am not sure if you can put 100 hardcoded, but if not, you can cretae a variable and put it then in the context), then you can use it inside the loop using {{$.loop.context}}

Let me know how it works for you

do you have an example with the offset?

What API call you’re using ? is it ISC API call ? can you share the API call with us (if possible) ?

if it only provides 100 objects per request, there should be a parameter “offset” which you can use for that matter.

Yes, it’s an API of IdentityNow → list-pending-approvals | SailPoint Developer Community We need to iterate over all elements up to X-Total-Count, but I saw that it is not possible to perform arithmetic operations in the URL with type {{offset + 100} or in the define variable

can you elaborate the purpose of this workflow? maybe there is a different way to handle it.

The workflow is intended to send notifications to Identities that have a role to approve, acting like a reminder (because this functionality is not natively supported by ISC).

I see the offset param, but unfortunately, you can’t update the context by adding 100 every time. What I did once was to evaluate the value of X-Total-Count, and if is less than 100, i use only one loop, if between 100 and 200, I use two loops, and same for between 200 and 300. But I was sure that the X-Total-Count can be greater than 300.

By the way, I think that the max possible iterations for a loop is 250, not 100.

Maybe you can try to send only the first 750 pending requests, and the next time, notifications will be sent to the other 750 pending requests, etc.

Does this help you resolving the issue ?

So in your implementation, to get to 750, it takes 3 cycles? How do you tell the loop in advance how many times it should run? For this reason, I wanted to create a list of objects, so the loop would iterate over that list and at the same time make the HTTP calls.

For something like this, I recommend you use PAG and execute the APIs from the remote host or just have a cron on a host and call the APIs as you needed. for a thing like reminder notifications, I find workflows very restrictive in number of things you can do in an efficient manner.

That was the last resort, I wanted to first understand if there was a way on IdentityNow, I can’t pass that list of my screen, inside the context of the loop?

or take a quick look at recursive workflows.

what I did is that I evaluate the length of the list :

(the limit was 100 before, now it is 250 :

)

if between 100 and 200, I used 2 loops :

So if you do the same, for three loops, you should have 750 pending requests covered, then these last will be handled by users, and will disappear and other 750 will be having notification sent. You can use “Scheduled trigger” so your WF will be triggered per the frequence you choose

You should have 3 branches in your workflow, something like this :

Is it possible to change the offset using recursion?