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 / Remove records from co...
Power Apps
Unanswered

Remove records from collection based on a lookup from another collection

(0) ShareShare
ReportReport
Posted on by

Hi all, 

 

I have an issue that I have had trouble finding the answer to and hope you can help 😊

 

First let's get the initial details out of the way:

  • It is a custom page that opens from a sub-grid
  • This custom page will allow users to add multiple records to the sub-grid, by selecting them from a gallery
  • The sub-grid record consists of a lookup to systemuser and some other datapoints that are not relevant

 

The current design goal is to display a gallery with all relevant sytemusers and then let the user pick from that list. The custom page will then create the records in the subgrid through a patch operation.

 

The problem we are facing is that we want to filter out the users that are a part of the current sub-grid records. For instance, if we have three relevant users and user1 has already been added as a lookup to the sub-grid record, then we want the custom page to only show user2 and user3.

 

Currently I am trying to make this happen in the OnStart property through collections:

 

Set(varCurrentRecord, Param("recordId")); 
Set(varCurrentRecord, Replace(Replace(varCurrentRecord, 1, "", "{"), 1, "", "}")); Notify(varCurrentRecord); 
Set(varCurrentRecord,"bf29b8b3-5ee5-eb11-bacb-0022489c01de");

ClearCollect(colSurveyInterviewers, Filter('Survey Interviewers', Survey.Survey = GUID(varCurrentRecord)));
ClearCollect(colUsers, Filter(Users, Not('Interviewer ID' = Blank())));

 

 I have overwritten the varCurrentRecord with a static GUID for development purposes.

 

The first collection 'colSurveyInterviewers' is a collection of sub-grid records from 'varCurrentRecord'

The second collection 'colUsers' is all relevant users

 

Now I want to remove records from 'colUsers' based on the lookup field from 'colSurveyInterviewers'.

 

How would I achieve this? I have tried RemoveIf to no avail - here is some of my attempts.

 

 

RemoveIf(ColUsers, User in LookUp(colSurveyInt.Interviewer.Interviewer, colSurveyInt.Survey.Survey in Text(varCurrentRecord)).dst_SystemUser.User);

RemoveIf(ColUsers, User = LookUp(colSurveyInt.Interviewer.Interviewer, colSurveyInt.Survey.Survey = GUID(varCurrentRecord)).dst_SystemUser.User);

 

 

Thanks in advance

Categories:
I have the same question (0)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 482 Most Valuable Professional

#2
11manish Profile Picture

11manish 459

#3
Haque Profile Picture

Haque 331

Last 30 days Overall leaderboard