cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jose_farinha
Frequent Visitor

Remove function is not removing

 

I have this relationship in Dataverse:

 

Meetings <-many-----many-> Employees

 

and a gallery where I'd like to list those that were not at a meeting.

 

Since I cannot do an outer join directly on Dataverse, I used the following strategy:

 

ClearCollect (all,

                     Employees);

ClearCollect (attendants,

                     myMeeting.Employees);

ClearCollect (absent,

                     Remove(all, attendants));

 

However, the gallery that I have linked to absent is displaying all employees.

Apparently, Remove(all, attendants) is not removing.

 

I've tried several variants, such as:

   Remove(all, myMeeting.Employees)

   Remove(all, myMeeting.Employees, All)

But none yields the expected result, they either show all employees or a gallery filled with empty entries.

 

Why is that? Any hint? 

 

Thanks in advance.

 

1 ACCEPTED SOLUTION

Accepted Solutions
zaphod88
Responsive Resident
Responsive Resident

How about

ClearCollect(absent, Filter(all,!(ID in attendants.ID)))
You have to replace ID by your unique identifier if there is no ID column.

View solution in original post

4 REPLIES 4
JR-BejeweledOne
Super User
Super User

I don't see where you are actually collecting any information into 'absent'.  Where is absent supposed to get it's data?



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.
jose_farinha
Frequent Visitor

Thanks for your reply, @JR-BejeweledOne .

In response to your question: it's the 3rd statement that is setting absent:

 

ClearCollect (absent,

                     Remove(all, attendants));

 

I'm trying to assign to it all employees except those in attendants

I believe I'm using this syntax of Remove (al least, studio tells me that attendants is being interpreted as a table):

Remove( DataSource, Table [, All ] )

  • DataSource – Required. The data source that contains the records that you want to remove.
  • Table – Required. A table of records to remove.
  • All – Optional. In a collection, the same record may appear more than once. You can add the All argument to remove all copies of the record.

 

zaphod88
Responsive Resident
Responsive Resident

How about

ClearCollect(absent, Filter(all,!(ID in attendants.ID)))
You have to replace ID by your unique identifier if there is no ID column.

View solution in original post

jose_farinha
Frequent Visitor

That worked 👍

I was wishing that a less verbose, non-IT people solution existed.

Thanks, anyway.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (49,541)