Server Action Folder List : Paging, Sort and Search

Simply brilliant and brilliantly simple! (when you know how :laughing:)
That’s great BUT I needed to change things slightly for my own case.
I wanted to search anywhere in the file name and so I substituted “startsWith” with “contains”. Then I found that it was case sensitive so I converted everything to lowercase, and here is my final filter…

filter="name.lowercase().contains(filter_reports_msword.value.lowercase())"

It seems to work :smile:

EDIT
I’ve just taken it one stage further and removed spaces as well, this means that if a file has a registration number in it such as NR16 GBY with a single space then when the user searches, it won’t matter if they put
NR16GBY
NR 16 GBY
N R16GBY
it will still find the file.

filter="name.lowercase().replace(' ', '').contains(filter_reports_msword.value.lowercase().replace(' ', ''))"

I hope this helps others.