cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
xyd
Helper II
Helper II

Filter on a lookup field using "in" doesn't work

so I have 3 tables

TableA has fieldA which is a lookup field to table B

TableC has fieldC which also is lookup field to table B

 

My canvas app is embedded on TableD which has a 1:N relationship with TableA.

 

So I can get records from TableA.

I can see the fieldA lookup field values in a Gallery.

But I can't then use fieldA lookup field values to filter tableC, is there an issue with this formula?

Filter(TableC, fieldC.guid in TableA.fieldA.guid)

I have also tried

Filter(TableC, fieldC in TableA.fieldA)

Thinking using the record itself but no luck, the filter always bring back empty results.

 

Currently I had to use a ForAll to build my collection instead of using Filter, which I think it's not ideal.

 

Delegation is not an issue at this moment as there are only handful records in all tables.

 

I know look up field is always a bit tricky...

 

2 REPLIES 2
dpoggemann
Super User
Super User

Hi @xyd ,

 

I completed a test to perform I think what you are trying to do here.  I did the following:

1.  Utilized Accounts table which has a field "Primary Contact"

2.  Created a second table called Drew Test that had a field called "Contact"

3.  Created a gallery to show all Account records and the subtitle field is the fullname of the Primary Contact

4.  Created a second gallery that would show the records in Drew Test where the "Contact" field matched the selected record from the Account gallery based on the Contact being the same...

 

The filter that worked for this was:  

Filter('Drew Tests',Contact.Contact in Gallery1.Selected.'Primary Contact'.Contact)

Screen Shot 2021-07-08 at 5.22.10 AM.png

 

Hopefully this helps you to solve your issue.  Please accept if answers your question or Like if helps in any way.

 

Thanks,


Drew

Hope this helps. Please accept if answers your question or Like if helps in any way.
Thanks,
Drew
xyd
Helper II
Helper II

@dpoggemann 

Thanks for your response.

 

What I need is to do is the filtering against a list of records not just the selected one.

Having said that, it is interesting that your filtering is against the gallery items instead of the connected DS directly.

I think that might just do the trick! Will try that at some point soonish.

Thanks anyways

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (1,363)