How to loop through multi-valued account attribute in transforms?

Hi all,

I’m working on a transform where I need to process a multi valued account attribute — in this case, groups. Here’s an example of what it looks like:

I need to loop through this list and check if a specific static value (e.g., 00gir95loplEZf66V5d7) exists within the list. Based on the result, the transform should return either "found" or "not found".

Has anyone implemented a similar solution?

Any input would be appreciated!

Hi @kalyan_dev32,

Take a look at this thread and see if it helps:

@jesvin90 Is there any other way to achieve this? I’m looking for a way to iterate over each value and evaluate multiple conditions for each item.

Hi @kalyan_dev32
I would suggest to use contains operator.
i.e something like #if($groupVariable.contains('00gir95loplEZf66V5d7'))Found#{else}Not Found#end

Apart from that If you are looking to iterate over each item, then i would suggest you use the below
"value": "#set($array=$Multivalued.split(\"\\s+\"))#foreach($val in $array)val = $val #end"

I have set the multivalued attribute as something like this:
image
Have entered the value as “Separated by new Line”, and on ISC it comes as separated by space.

Example on account attribute:
image

And this is what i see in my identity attribute as a result.
image

Hope this helps :slight_smile:

Thank you @jesvin90 and @neeraj99 for your help!

The approach shared in this thread really helped in my case:

1 Like