Showing List or Library control data to show only one row of data base on person name

Hello,
I've added a List or Library control from a list called Assetlists to my form in Plumsail. Assetlists has our company employees and their computer IP, Model, Location, Custody (employee name), etc. The Plumsail form shows the whole list of all employees when I test it but I would like to only show one row of data of an employee and their computer IP, Model, Location, etc based on their name (Custody).

I've been trying to look for some code or an example from the documentation but seem to be using the wrong code. It would even be better if this information could populate automatically after I've input an employee name already in a field called EmployeeName on the top of this form. Any help would be appreciated, thank you.

Hello @lso,

You can filter records in List or Library control dynamically using CAML query. You can find the example in the documentation here.

Note that to filter 'Person or Group' field by user name you need to set the 'Value Type' to be qual User

<Contains><FieldRef Name='ColumnName'/><Value Type='User'>Jane Doe</Value></Contains>
1 Like

Hi @mnikitina,

This is great! Thank you for the assistance. I also got it to work with a person that was defined earlier in the form with some assistance by adding this variable that is in another earlier set of code to the new code:
var employee = fd.field('EmployeeName').value;

And adding this in between Value Type:
" + employee.displayName + "

1 Like

Hi @mnikitina,
With this filtering code working now I also need to not show certain columns. Right now it's showing all columns from the called up Asset list. Let's say I don't want to show the Location and IP from the employee's Asset list. Or I want to only show certain columns from this person's Asset list and not show others. Can you assist me with some sample code?

Thank you

Hello @lso,

You can choose a specific List View in the List or Library control Data Source settings.
image

To hide/show columns, modify the List View. If you need to display different views dynamically, you can add multiple List or Library control to the form and show/hide them dynamically.

1 Like

Thank you! Modifying the list view seems like the easiest way.

1 Like