How to filter the record in list library

Hi ,

I have SP form with a lookup control and list library. when the form is loaded, I would like to filter out the record in list library in lookup control. anyway to do that? By default the lookup control didn't select any item yet.

image

image

e.g.

Dear @Derek_wong,
Sure, that's possible. Please, check out this example here - Manipulate fields in inline editing mode of List or Library — SharePoint forms

Hi, that one is base on the selected value on the dropdown list. However, my requirement is
when the form is generated/load, the custodian dropdown won't select any option (by default it have 5 options), the data table will show all the record as long as the custodian column belongs to those 5 options.

Dear @Derek_wong,
This is just an example, you can adjust it to your case. I am not 100% clear on what your case is, can you provide some screenshots and a description of how you want it to work?

hi Nikita,

I have solved the problem, but do you know how can I map the field to dropdown, below is my code.

when I click "edit" button on list library, i would like this textfield change to dropdown. so that people can select the value from dropdown instead of free typing it.


I have this event as below, however, if I follow this example, https://plumsail.com/docs/forms-sp/how-to/dynamic-datatable.html#source-lists, it won't work, it will flow error and say "e.column.field" is undefine.

fd.control('SPDataTable1').$on('edit', function(dt) {
alert('check change column name => ' + dt.column.field);
console.log(dt);
if (dt.column.field === 'Custodian'){
// populateCategories(dt.widget);
}
});

Dear @Derek_wong,
And what's the type of column the Custodian field is?

textfield in sharepoint doc list

Dear @Derek_wong,
Okay, you can just change it in List Settings > Custodian Column, change type to Choice.

Dear @Nikita_Kurguzov ,

I did that before, however, when I show the list library on plumsail , it will show as textfield. not sure what is not correct. I wonder what is the correct way to do it, do you have example for me.

Dear @Derek_wong,
You need to open the form, select List or Library control, open Data Source configuration and let it update. No need to change anything, just save the form after it - this will allow List or Library to load the latest changes in list configuration.

Dear @Nikita_Kurguzov

anyway to show as dropdown with column is changed.

Dear @Derek_wong,
You first edit the Custodian column and Change its Type to Choice:

You then open form with List or Library, click List or Library and open Data Source configuration:
image

Click OK:
image

This automatically updates Data Source and the field type in List or Library, so it says Selected Item under Custodian instead of Some text:
image

Then you save the form:
image