Filtering and adding detail to a Look Up function

I am attempting to add details to a lookup but also filter it.
The adding of the Number works however the filtering does not.

Below is my Code

fd.spRendered(function() {
    function filterLookup(v){
        // getting the selected Choice (0 if nothing is selected).
        var choice = v;
       

        // setting filtration
     
        fd.field('Positions').filter = "HRStatus eq 'Open/Active'";
   
    }

    //filter when form opens
    filterLookup(fd.field('Positions').value);

    //filter when Choice changes
    fd.field('Positions').$on('change', function(value){
        filterLookup(value);
     
    });
    var template = '';
	 template += '<span сlass="lookup-col">';
	 template += '<p сlass="lookup-title"> #: data.LookupValue # </p>';
	 template += '<p class="lookup-desc">#: data.Id ? "  " + data.Id : "" #</p>';
	  
      
    fd.field('Positions').widgetOptions = {
        template: template,
	   height: 400,
        virtual: {
        itemHeight: 100
        }
    }

    // Calling hideOrShowDueDate when the user changes the Start Date
    fd.field('Status').$on('change',hideOrShowDueDate);

    // Calling hideOrShowDueDate on form loading
    hideOrShowDueDate();
	
});

Dear Jennifer,
I’ve tested the code, and the filtering definitely works (though some parts are redundant, but I’ve kept them to ensure that we test the same), not sure what could be going wrong.

A couple of ideas:

  1. I can see hideOrShowDueDate being used twice in the code, but there is no actual function with this name included. If such function doesn’t exist, it could cause an error and thus making filtering fail.
  2. HRStatus might not be correct internal name of the field in the source list, check out the Internal Name.
  3. HRStatus might be not choice/text, but a lookup field, and this filtering wouldn’t work then.

Please, check these out. If you try this code after checking the Internal Name and making sure it’s correct, the filtering should work:

fd.spRendered(function() {

    fd.field('Positions').filter = "HRStatus eq 'Open/Active'";

    var template = '';
	template += '<span сlass="lookup-col">';
	template += '<p сlass="lookup-title"> #: data.LookupValue # </p>';
	template += '<p class="lookup-desc">#: data.Id ? "  " + data.Id : "" #</p>';
	 
    fd.field('Positions').widgetOptions = {
        template: template,
	   height: 400,
       virtual: {
           itemHeight: 100
       }
    }	
});