cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mrQ
Helper V
Helper V

Compare two collections doesn't work?

Dear all

 

I have a dataverse for teams table called Registered Users and another called Eligible Users.

I would like to check if some of the Registered Users are in the Eligible Users table and I'm checking against the 'Azure AD Object ID' as the unique identifier.

 

// in 'Eligible Users' I have a column called cr466_User2 that has previously been saved from the 'Registered Users' table to the 'Eligible Users' table

ClearCollect(
    colCheck,
    Filter(
        'Registered Users',
        'Azure AD Object ID' in 'Eligible Users'.cr466_User2.'Azure AD Object ID'
    )
)

 

My colCheck collection stays empty and I'm wondering why? The 'Eligible Users' table includes Azure AD Object ID's from 'Registered Users'. See here:
compared-users.png

 

I would appreciate your help. Thanks and happy easter!

1 ACCEPTED SOLUTION

Accepted Solutions
FabianAckeret
Super User
Super User

Hi @mrQ 

 

Try your formula the other way around.

Something like:

ClearCollect(
    colCheck,
    Filter(
        'Eligible Users',
        cr466_User2.'Azure AD Object ID' in 'Registered Users'.'Azure AD Object ID'
    )
)

 

That helped me often times... Why? I can't really answer that apart from "it might be a bug" OR "it has something to do with the relations of the tables". Meaning, I assume while executing, PowerApps can't access some of the columns right away (e.g. Azure AD Object ID from 'Eligible Users'.cr466_User2). However, if you Filter on the 'Eligible Users', you automatically have that info already (as its stored in the table) and while your 'Registered Users' table is flat, it doesn't encounter that issue there.

 

I hope it makes sense... I'm not a big fan of using Dataverse for exactly that reason. I've been working with other databases and their relationships before and I never encountered as many issues as with Dataverse. 

However, if you know the "bugs" or limitations then Dataverse (and especially Dataverse for Teams) can be very handy/cost effective.


Please click Accept as Solution if my post answered your question. Like my answer? Consider giving it a Thumbs Up. Others seeking the same answers will be happy you did.

View solution in original post

2 REPLIES 2
FabianAckeret
Super User
Super User

Hi @mrQ 

 

Try your formula the other way around.

Something like:

ClearCollect(
    colCheck,
    Filter(
        'Eligible Users',
        cr466_User2.'Azure AD Object ID' in 'Registered Users'.'Azure AD Object ID'
    )
)

 

That helped me often times... Why? I can't really answer that apart from "it might be a bug" OR "it has something to do with the relations of the tables". Meaning, I assume while executing, PowerApps can't access some of the columns right away (e.g. Azure AD Object ID from 'Eligible Users'.cr466_User2). However, if you Filter on the 'Eligible Users', you automatically have that info already (as its stored in the table) and while your 'Registered Users' table is flat, it doesn't encounter that issue there.

 

I hope it makes sense... I'm not a big fan of using Dataverse for exactly that reason. I've been working with other databases and their relationships before and I never encountered as many issues as with Dataverse. 

However, if you know the "bugs" or limitations then Dataverse (and especially Dataverse for Teams) can be very handy/cost effective.


Please click Accept as Solution if my post answered your question. Like my answer? Consider giving it a Thumbs Up. Others seeking the same answers will be happy you did.

View solution in original post

mrQ
Helper V
Helper V

Hi  @FabianAckeret 

 

Thanks for your answer.

 

That would work, but since I need some of the columns of Registered Users I can't possibly swap the statement.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,083)