cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Filter 2 collections by shared lookup field

Hi, i have two collections:

  • K1UslugiUmowy and
  • K1KonsultanciUmowy.

Each of them have the same lookup field UmowaO directing to other collection (KUmowyKlienci). I want to filter KUmowyKlienci only to records that are equal to K1.UslugiUmowy.UmowaO and K1KonsultanciUmowy.UmowaO. How I can do that?

 

I tried to make something like below, but I've got an error (something like this: identyfikator can't be converted from numer to record):

 

ClearCollect(K2UmowyKlienci;Filter(KUmowyKlienci;Identyfikator in K1KonsultanciUmowy.UmowaO;Identyfikator in K1UslugiUmowy.UmowaO))

 

Thanks,

Peter

2 REPLIES 2
Highlighted
Super User
Super User

Re: Filter 2 collections by shared lookup field

If UmowaO is a lookup then the value maybe stored as a record and if that is the case then you need to make a slight change to your formula. 

 

ClearCollect(K2UmowyKlienci;Filter(KUmowyKlienci;Identyfikator in K1KonsultanciUmowy.UmowaO.Value;Identyfikator in K1UslugiUmowy.UmowaO.Value))


--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Highlighted
Frequent Visitor

Re: Filter 2 collections by shared lookup field

Thank @Jeff_Thorpe for the reply. UmowaO is a lookup column. When I test your code, PowerApps throw me an error that "Value" name is not proper and ID is not recognised. When I'am writing "UmowaO.", then PowerApps doesn't show me any prompt.

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,001)