Lookup filter not working as expected

Hi @Margo @IliaLazarevskii @Nikita_Kurguzov,

On my ongoing project, I have two lookup fields (OrgUnit and HostInst).
Pic for clarity:

Requirement:
--> The HostInst options depends on the value of OrgUnit.
--> Show only Active (yes) HostInst

The problem:
Filter depends on Plumsail works but I need to filter on two columns:

fd.field('HostInst').filter = `iPathN1 eq 'Faculty of Economics and Business' and Active eq 'yes'`

// I have the following in my plumsail JS:
fd.spRendered(() => {
    fd.field('OrgUnit').$on('change', function(value){
        fd.field('HostInst').ready(field => {
            field.filter = `iPathN1 eq '${value.Title}' and Active eq 'yes'`;
            field.refresh();
        });
    })
    fd.field('HostInst').useCustomFilterOnly = true; //it doesnt work with or without this. 
});

When I do the following, I get some double values and some are not even shown:


The expected results are:

Could you please help me here?

Hi @asmita_adh,

I couldn't reproduce the issue so far.
Could you share all of the form's code? Are there duplicate values in the source list of the lookup?

Hi @IliaLazarevskii,

The code above is all I have in my editor.

Could you try with a large list? My lookup list has 700 items

Hello @asmita_adh,

What are the types of the iPathN1 and Active columns in the source list?

Hi @Margo,

They are both Single Line Text fields.

@asmita_adh,

Are you getting any errors in the browser console? Please share a screenshot.
Also, please make sure that the Active field's internal name is valid and that the data in the column is consistent. For instance, filter won't work s you expect if the column value has space like so: ' yes'

@Margo,

Appreciate your suggestions but all your points have been ruled out. Like I explained, the problem is not that the filter isn't working, the problem is that there are duplicate values. PLEASE refer to the images above.

Have you been able to reproduce this? Did you try it in your end? If you want, I can give you permissions to my site to see the problem and maybe find a solution.

Please note that when I use pnpjs, then i get the desired results back. So this is definitely a BUG in Plumsail.

@asmita_adh,

I couldn't reproduce the issue on my form with lookups pointing to a large list. That's why I assume the issue might be with the source list.
Are there duplicate records in the iPathN1 column with different Active column values?
What PnP function are you using? What is the result? Can you filter data in a SharePoint list view manually and see the same result?