cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RussellGove
Level 8

How to find items in one collection that dont exist in another collection

So I have a list of Items (called myItems)that come from SQL displayed in a gallery and I let users select items by checking a checkobox in the gallery template. The list has a primary key ID, When the item is selected , i collect it to a second collection called selectedItems.


Now i have buttons that let the users perform process on the selected or the unselected items. How do i get a list of unselected items (i.e. items that are in myItems but not in selectedItems).

 

I thouht this would be easy with a forAll statement so i started coding:


ForAll(myItems,If (LookUp(SelectedItems,ID=ID,true,false),Collect(unselecected,t.....

 

But then i realized that i cannont compare the ID of the selectedItem with the item from the forall loop because it doesnt give us a ThisItem object to work on.

 

Anyone have ideas how to do this?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: How to find items in one collection that dont exist in another collection

Hey @RussellGove

 

 

Is there a boolean that you pass if something is checked or not, if so then you could collect the unchecked equals false ones (unselected items).

 

Kind regards

 

Tom





Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!





2 REPLIES 2
Highlighted
Super User
Super User

Re: How to find items in one collection that dont exist in another collection

Hey @RussellGove

 

 

Is there a boolean that you pass if something is checked or not, if so then you could collect the unchecked equals false ones (unselected items).

 

Kind regards

 

Tom





Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!





Administrator
Administrator

Re: How to find items in one collection that dont exist in another collection

Thank you for taking the time to review and reply to this post @Tom_Slosse

 

@TopShelf-MSFT