cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RussellGove
Kudo Kingpin
Kudo Kingpin

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
Tom_Slosse
Memorable Member
Memorable Member

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



If this reply has answered your question or solved your issue, please mark this question as answered.

Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

View solution in original post

2 REPLIES 2
Tom_Slosse
Memorable Member
Memorable Member

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



If this reply has answered your question or solved your issue, please mark this question as answered.

Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

Anonymous
Not applicable

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

 

@Anonymous

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (2,509)