Apply filtering via buttons based on document's TAX YEAR

I have a datatable with some documents in it and would like to add buttons that filter the table based on the year pressed

Hello @Mikellas,

Welcome to Plumsail Community!

You can filter List or Library dynamically using the code. Please find the instructions here:
Filter by one field dynamically

Hello and thanks for the prompt reply,

Can this be achieved with the use of buttons e.g having buttons filtering based on the year correspondind to the button value?


Yes, you can add code to the button's "Click" property to filter the data.

Code example:

var dt = fd.control('SPDataTable1');

dt.filter = "<Contains><FieldRef Name='Title'/><Value Type='Text'>" +
    "2022" + "</Value></Contains>";