web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Deleting a collection ...
Power Apps
Unanswered

Deleting a collection items if it exists in another collection and dealing with lookup column inside a collection

(0) ShareShare
ReportReport
Posted on by

Hi All, 

 

I am new to canvas apps and I still trying to understand how Collection works. 

 

first, let me explain the task I want to achieve: 

I have a canvas app that uses Dataverse as a data source, in the dataverse there is a table called: Challenge Participants simply it creates a manual relationship between 2 entities: Athlete and Challenges. so it has M-1 relationship with both entities. 

 

athletes(which are contacts in dataverse) need to access 2 screens from the canvas app:

1. Active challenges that they have not enrolled in yet.

2. Active challenges that they have enrolled in.
both screens will be simple screens showing a gallery for each filtered record.


for 1st screen, the filter is:
Distinct(Filter('Challenge Participants','Athlete '.Contact<>First(currentAthlete).Contact && Challenge.'Status Reason'='Status Reason (Challenges)'.Active),Challenge)

the 2nd screen :
Filter('Challenge Participants','Athlete '.Contact=First(currentAthlete).Contact && Challenge.'Status Reason'='Status Reason (Challenges)'.Active)

 

the problem is with 1st screen, I believe the filter is wrong, at least I have to store it in a collection lets call it: activeChallengeParticipants and by somehow process it to REMOVE its item if it is in the myActiveChallengeParticipants 


I assumed that is the only way here, so I created in the app start these 2 collections, and i desperately tried to achieve this approach with no success, i tried things like removeIf and like using a temp collection 

but i think the issue is that when i create these filters into collections, the columns of the lookup fields (which are athlete and challenge) is created as tables inside the collection table, and i do not know how to access it, it is not accessible through the "dot" 

 

here is how i create the collection: 


ClearCollect(
myActiveChallengeParticipants,
Filter(
'Challenge Participants',
'Athlete '.Contact = First(currentAthlete).Contact && Challenge.'Status Reason' = 'Status Reason (Challenges)'.Active
)
); 

and this is how to appears in the table: 

beer__0-1680260245278.png

 

i tried to follow this structure: RemoveIf(Collection2, Not(ID in Collection1.ID))


but in my case i could not access the collection lookup fields, so: 

RemoveIf(activeChallengeParticipants, Not(activeChallengeParticipants[@ap_Challenge].Challenge in myActiveChallengeParticipants[@ap_Challenge]));

>> but this throw error: 

beer__2-1680260658199.png

 

 

so i tried: 

beer__3-1680260707426.png



my questions are: 

1. is using collections and processing it to delete the active participant if it was in my active participants collection is the correct approach?
2. if yes, how can i do that?
3. how can i generally access lookup field into a collection? as it appears to be saved as a table inside a table? 

thank you all! 




Categories:

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard