Disable item in SP list from showing based on YES/NO field

Hi

I have a sharepoint list of approvers and I want to be able to disable staff who no longer work at the company from being approvers based on the Active field/ column. The Active Column is a Yes/No field.

I can't figure out what JS I need.

Hello @SClacherty1,

Could you please provide more details about your case.

How do you want staff to be disabled?
Do you want this users to be hidden within the lookup field or List or Library control?

OK, I hope I explain this well because it is a bit confusing.

We have a form that filters based on cost centre - using the Extra Fields and the Expand properties

Expense Record Form Properties - Approver

The result

The Cost Centres and Approvers are populated from 2 SharePoint lists

Approvers

Cost Centres

So if the Approver leaves - we would make them inactive and then they wouldn't show in the list any longer. Also, I would love for the same to happen for Cost Centres. Weirdly my organisation has been changing cost centres names around a little

Really hope this makes some sort of sense.

Hello @SClacherty1,

Thank you for clarification!

You can create a static filter to show only items which status is active using JavaScript:

fd.spRendered(function() {
    fd.field('LookupFieldName').ready().then(function(){
        fd.field('LookupFieldName').filter = "Active eq true";
        fd.field('LookupFieldName').refresh();
    });
});