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

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, September 18th at 8am PDT

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 271 members 4,638 guests
Please welcome our newest community members: