How to filter records in the lookup linked table

Hi,
I was wondering if it is possible to filter linked table in form by another linked data.

in my table fields:

  • I have linked to table “Company” (has link field to “Contacts” table)
  • I have linked table “Contacts”
  • when user select “Company” I want to filter contact which belongs only to selected company

I tried to use “Add field for filter”, but I don’t see the way how write down javascript condition. It is possible? Is there any example?

Hello Jaroslav,

I’ve already added an article on this topic with all the information. You can find this article here:

I am also sending a similar JS below:

if (doo.model.<[Inquiring company (inquiringCompany)]>.value?.id) 
    doo.model.<[Contact person (contactPerson)]>.filterForDropdown = 'company.id === ' + doo.model.<[Inquiring company (inquiringCompany)]>.value.id; 
else 
    doo.model.<[Contact person (contactPerson)]>.filterForDropdown = null; 

Have a beautiful day.

With kind regards,
Soňa

2 Likes