Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
Answered

filter some items from data source

(0) ShareShare
ReportReport
Posted on by 482

Dear community

 

I have a dataverse for teams table called Registered Users. It has a column called Azure AD Object ID

Based on another table called Not Valid, I created a collection colNotValid. It has a lookup to the Registered Users table.

 

In my gallery, I would like to show all items in Registered Users WITHOUT the ones that are in the colNotValid collection (column 'cr466_User2').

 

 

Filter(
 'Registered Users', 
 Not(
 'Azure AD Object ID' in colNotValid.cr466_User2.'Azure AD Object ID'
 )
)

// tried the following alternative, but didn't work either (Registered Users is the unique identifier of 'Registered Users'

Filter(
 'Registered Users', 
 Not(
 'Registered Users' in colNotValid.cr466_User2.'Registered Users'
 )
)

 

 

 

Above code doesn't do that and I don't know why. It simply shows ALL users from Registered Users. If I remove the Not() it won't show any users. What am I doing wrong?

 

Thanks in advance for your help.

 

**edit**

This feature is activated but the behavior is the same with collections directly.

feature-active.png

Categories:
  • mrQ Profile Picture
    482 on at
    Re: filter some items from data source

    Sounds to me like a bug... 😕

  • v-albai-msft Profile Picture
    on at
    Re: filter some items from data source

    Hi @mrQ ,

    Glad you have solved your issue.

    Actually, I cannot find an official document mentioned that why we cannot directly use formula like "Table2.lookup.Name". So each time I have your issue, I will keep the lookup result into a new column. And this did work😁

    Best regards,

    Allen

  • mrQ Profile Picture
    482 on at
    Re: filter some items from data source

    Thanks! That worked!

    I just don't get why I need to save it to a new column when this information is already there in a relational database...?

  • Verified answer
    v-albai-msft Profile Picture
    on at
    Re: filter some items from data source

    Hi @mrQ ,

    How do you create the collection colNotValid?  Using formula like below(may should be “Not Valids”)?

    Collect(colNotValid, 'Not Valid')

    If yes, try this to create this collection(save the lookup column into a new column called "test2"):

    Collect(colNotValid, AddColumns('Not Valid',"test2",cr466_User2.'Azure AD Object ID'))

    Then in your gallery, try this:

    Filter(
     'Registered Users',
     Not(
     'Azure AD Object ID' in colNotValid.test2
     )
    )

    Best regards,

    Allen

  • Drew Poggemann Profile Picture
    9,278 Most Valuable Professional on at
    Re: filter some items from data source

    Hi @mrQ,

     

    Can you try the following for the filter:

    Filter( 'Registered Users', !('Azure AD Object ID' in 'Not Valid'.cr466_User2))

     

    I am doing this from memory so hopefully I got it right 😀

     

    Hope this helps.

     

    Thanks,


    Drew

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Microsoft Dataverse

#1
mmbr1606 Profile Picture

mmbr1606 22 Super User 2025 Season 1

#2
stampcoin Profile Picture

stampcoin 17

#3
ankit_singhal Profile Picture

ankit_singhal 11 Super User 2025 Season 1

Overall leaderboard

Featured topics