cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Collection Variable Comparison

Jump to solution

Hello,

We have a workflow which contains two collection variables,
within each collection variable it holds a listing of users which was retrieved
by querying a list which contained a people picker field.  An example
scenario would look like the following:

With the example above, we are looking for a way to compare
these two variables, what we need to identify are two things:

Collection Variable 1

Collection Variable 2

Tanmay, Thakar

Tanmay, Thaker

Ashish, Patel

Ashish, Patel

Joy, Christian

Chunara, Minesh

David, Tom

  1. Users contained in Collection Variable 2, that
    are not contained in Collection Variable 1 (in this case it is Chunara, Minesh
    and David, Tom)
  2. Users contained in Collection Variable 1, that
    are not contained in Collection Variable 2 (in this case it is Joy, Christian)

How could we accomplish, is there an action which could help
us achieve this?

0 Kudos
Reply
3 Replies
Automation Master
Automation Master

Re: Collection Variable Comparison

Jump to solution

Hi Minesh,

In two steps.

Step 1, loop on the Collection Variable 2. For each value, use the Exists operation in Collection Variable 1.

Each time it returns false, store the value in a new collection variable with the Add operation of a Collection Variable. You can maybe use Remove by value if Exists return true but I do not know if the loop on the Collection Variable is affected or not.

Step 2, same case, just exchange the Collection Variable name.

Hope it helps,

Christophe Raucq

0 Kudos
Reply
Not applicable

Re: Collection Variable Comparison

Jump to solution

Thanks for your solution.

Can you give me more detailed steps for comparing workflow
collection variable?

0 Kudos
Reply
Automation Master
Automation Master

Re: Collection Variable Comparison

Jump to solution

Hi Minesh,

You can find all operations on Collection Variable here.

But you cannot compare Collection Variables between them.

That is why you need two steps.

Regards,

Christophe

0 Kudos
Reply