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

Compare Two Collections?

Jump to solution

Hi,

 

I am trying to create a workflow that compares two collections, if there are items in one collection that are not in another I want the workflow to collect those items in another collection. Does anyone know if this is possible? Let me know if I need to elaborate on my workflow process.

 

Thanks for the help!

Labels: (1)
Reply
4 Replies
christopheraucq
Automation Master
Automation Master

Re: Compare Two Collections?

Jump to solution

Hi Nick,

If I understand it well you have 2 collections

Source Collection 1: A,B,C

Source Collection 2: A,B,D,E

The Target Collection will be: C,D,E

Here is my suggestion

For each element of Collection 1

Use Exists method of a collection to check if element of Collection 1 is in Collection 2

If does not exist use Add method to insert the element in the Target Collection

For each element of Collection 2

Use Exists method of a collection to check if element of Collection 2 is in Collection 1

If does not exist use Add method to insert the element in the Target Collection

Hope it helps

Regards,

Christophe

View solution in original post

Reply
burkslm
Nintex Newbie

Re: Compare Two Collections?

Jump to solution

Are you comparing two site collections or two collection variables?

Reply
Not applicable

Re: Compare Two Collections?

Jump to solution

It is actually two collection variables.

Regards,

Nick

Reply
burkslm
Nintex Newbie

Re: Compare Two Collections?

Jump to solution

Yes,

Source Collection 1

Source Collection 2

New Collection

  • Foreach action
  • Use Collection Operation action
  • Select 'Exists'
  • Set to a variable
  • Use If action based on if Exists is Yes/No
  • If no, use 'add' method for New Collection/if yes do not use add
Reply