cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Revlock97
Resolver I
Resolver I

Filter Dropdown items from Separate Table

I have 2 tables (Groups and GroupMembers) wherein I wish to filter all distinct ProductNames on a dropdown from Groups which is connected with GroupMembers via GroupID PK but I'm having trouble getting it to work. Thank you very much in advance for any help.

 

Screen OnVisible:

ClearCollect(colUserGroupID, Filter(SAP_GroupMembers, EmailAddress = varUserName.Email));
ClearCollect(colProductGroup, Filter(SAP_Groups, GroupID = colUserGroupID.GroupID));

Revlock97_0-1668047738364.png

 


Dropdown Items:

Distinct(colProductGroup, ProductName)

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Revlock97 ,

 

Please try:

ClearCollect(
    colProductGroup,
    ForAll(
        Filter(SAP_GroupMembers, EmailAddress = varUserName.Email),
        GroupID
    )
)

 

Best Regards,

Bof

View solution in original post

8 REPLIES 8
v-bofeng-msft
Community Support
Community Support

Hi @Revlock97 ,

 

Please try :

ClearCollect(colUserGroupID, Filter(SAP_GroupMembers, EmailAddress = varUserName.Email));
ClearCollect(colProductGroup, Filter(SAP_Groups, GroupID in colUserGroupID.GroupID));

 

Best Regards,

Bof

@v-bofeng-msft  It gives the following error for GroupID:

Revlock97_0-1668049227490.png

 

 

Hi @Revlock97 ,

 

Could you please tell me what the 'GroupID' in SAP_GroupMembers is? Could you show me its data structure? Or provide a demo of the SAP_GroupMembers in JSON format?

 

Best Regards,

Bof

@v-bofeng-msft This is its ERD. I just want to display the ProductName (Or still Product in the ERD) on the dropdown which is  filtered after taking into account all groups possibly assigned to a single group member. Thanks!

 

Revlock97_0-1668049817292.png

 

Hi @Revlock97 ,

 

Could you please tell me what the data source is ? Are there SharePoint lists? Could you provide some screenshots (please mosaic the private information)?

Can you determine that both groupids are string column? Is it possible that one of them is a lookup field?

 

vbofengmsft_0-1668050361107.png

I've made a simple test and it worked well:

vbofengmsft_1-1668050481422.png

 

Best Regards,
Bof

 

Hello @v-bofeng-msft 

 

I'm using Dataverse. As for the GroupIDs, yes the GroupID in SAP_GroupMembers is of LookUp datatype...the other GroupID is of Autonumber datatype

Revlock97_1-1668051197755.png

Apologies for being quite unclear I'm still kinda new to all this. Thank you!

 

 

Hi @Revlock97 ,

 

Please try:

ClearCollect(
    colProductGroup,
    ForAll(
        Filter(SAP_GroupMembers, EmailAddress = varUserName.Email),
        GroupID
    )
)

 

Best Regards,

Bof

@v-bofeng-msft I  just made some adjustments and it's working perfectly as intended!  Thank  you very much!

 

Revlock97_0-1668052940023.png

 

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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