Hide lookup values


I have a data table and one of the columns is a lookup dropdown. Is it possible to hide specific values from the lookup dropdown?


Hello @ParAvion,

You can configure a static or dynamic filter of the lookup column in List or Library control. Please find the example in our documentation here:

Thanks, what code would I use to filter out any lookup value that contacts "DO NOT USE" by default?

Hello @ParAvion,

You can apply a static filter using this code:

fd.spRendered(function() {
    fd.field('LookupField').ready().then(function() {
        fd.field('LookupField').filter = "Status eq 'DO NOT USE'";

Replace LookupField and Status with the field internal names.

Hi @mnikitina,

I was never able to get the code you suggested to work. Here are my form details:

List or Library control = SPDataTable1
Lookup field = "Item"
Lookup value = anything that contains "Do not use"

When the form is in Edit mode, I would like any lookup value that contains "Do not use" to be dynamically filtered out of the lookup value results.

Is this possible?

Thank you!

Dear @ParAvion,
The List or Library control is different, but you can still apply filtering to it, here - Manipulate fields in inline editing mode of List or Library — SharePoint forms

@Nikita_Kurguzov thanks I've reviewed this page but have not been successful at applying it to my work case as mentioned above. thanks.

Dear @ParAvion,
What do you mean? You just need to make sure to change all the field Names to your ones, for example, if the Lookup value is derived from Status field:

fd.spRendered(function() {
    fd.control('SPDataTable1').$on('edit', function(editData) {
        //exclude Office values with LookupFieldName > Status 'Do not use'
        editData.field('Office').filter = "LookupFieldName/Status ne 'Do not use'";