cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nagestiada
Post Patron
Post Patron

Exclude rows from gallery to a combo box

I have two sharepoint list,  MasterList and UserList
MasterList and UserList has EmpID as the unique and foreign key.

 

The goal is for my Combobox to filter all UserList who has a Role = Staff and exclude all MasterList rows that are in my UserList Gallery.

See my code below the first filter until role=staff is working but not sure what to do after the 'And' operator. (It should filter out all UserListthat are found in MasterList using EmpID.

Filter(MasterList,Role="Staff" && )

So if I have Item 1 in my UserList it will already be excluded from my combobox MasterList .

2 ACCEPTED SOLUTIONS

Accepted Solutions
CarlosFigueira
Power Apps
Power Apps

You can use the in operator (and the Not or ! operator), in an expression like the following:

Filter(
    MasterList,
    Role = "Staff",
    Not (EmpID in UserList.EmpID))

Hope this helps!

View solution in original post

v-qiaqi-msft
Community Support
Community Support

Hi@nagestiada,

Based on the issue that you mentioned, do you want to exclude all the records within the 'MasterList' if their roles are "Staff" and exist in the 'UserList'?

Could you please share a bit more about the scenario:

  1. Is the ComboBox populated with the 'Role' column or anything else?
  2. The 'Role' is a Text column, right? Combine that the formula you provided, it should be a Text type

Let me confirm it with you again, you want to exclude all the employees in 'UserList' that can be found in 'MasterList'. And you want to exclude them from the 'MasterList'. Also, these employees are "staff".

I assume that you want to filter all the items satisfying the "Staff" and "Could not be found in the 'MasterList'" at the same time.

Please check if the above need is what you want.

I have a test on my side, please take a try as below.

Set the Items property of the Gallery as below:

 

Filter(MasterList,Role="Staff" && !(EmpID in UserList.EmpID))

 

Best Regards,

Qi

View solution in original post

2 REPLIES 2
CarlosFigueira
Power Apps
Power Apps

You can use the in operator (and the Not or ! operator), in an expression like the following:

Filter(
    MasterList,
    Role = "Staff",
    Not (EmpID in UserList.EmpID))

Hope this helps!

View solution in original post

v-qiaqi-msft
Community Support
Community Support

Hi@nagestiada,

Based on the issue that you mentioned, do you want to exclude all the records within the 'MasterList' if their roles are "Staff" and exist in the 'UserList'?

Could you please share a bit more about the scenario:

  1. Is the ComboBox populated with the 'Role' column or anything else?
  2. The 'Role' is a Text column, right? Combine that the formula you provided, it should be a Text type

Let me confirm it with you again, you want to exclude all the employees in 'UserList' that can be found in 'MasterList'. And you want to exclude them from the 'MasterList'. Also, these employees are "staff".

I assume that you want to filter all the items satisfying the "Staff" and "Could not be found in the 'MasterList'" at the same time.

Please check if the above need is what you want.

I have a test on my side, please take a try as below.

Set the Items property of the Gallery as below:

 

Filter(MasterList,Role="Staff" && !(EmpID in UserList.EmpID))

 

Best Regards,

Qi

View solution in original post

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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

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

Top Solution Authors
Top Kudoed Authors
Users online (80,795)