Filtering bases using note aliases?

Hello! This might be more straightforward than I’m making it to be, but I haven’t found a solution and have not seen anybody asking about this, so I figured I’d ask here.

What I’m trying to do

I’m trying to create a base called “Author works” so that I can insert it in the notes I’ve created for some book authors or researchers and have it pull a list of all of their works.

So far I’ve made it work when the “author”/”authors” (the first is for non-academic books and the second for academic papers where several people are involved) properties contain the note title, but my problem is many of my notes on research papers don’t contain the name as it is on the note file, but rather a variation of it (like “A.” for the middle name if it’s “Andrew”). This data is pulled directly from my Zotero library via the Citations plugin, and I’d rather not have to manually edit each note to take off the initials of middle names since my intention is to quickly access all works by the same author even if I’ve forgotten I took notes on some of them.

I’ve added the name variations I’ve noticed as aliases for the author note, but have not been able to create a filter that correctly identifies them and displays the notes with said aliases in the “author”/”authors” property.

Things I have tried

These filters:

I’ve also tried changing “this.file.aliases” to “file.aliases” and “this.file.alias”, but neither of these work. With “this.file.aliases” and “this.file.alias” I get the following error message:

Failed to evaluate a filter: Cannot find “aliases” on type File

Is there any way to achieve what I want with bases?

Thank you in advance!

It may not be the only issue in your approach, but aliases is a file property. File properties are referenced as property_name or note.property_name, so the correct syntax in your base would be this.aliases.

Thank you for taking the time to reply. I tried to use this.aliases and got a different error message:

Failed to evaluate a filter: Type error in “contains”, parameter “value”. Expected String, given List.

Does that mean “contain” can only apply to text properties and not lists?

Yes, that is the issue.
You can use a function such as .containsAny.

You can try to enter this authors.containsAny(this.aliases) to your filters.
(Press the </> to the right and just paste it).

I am not sure if it will work, as I dont know how exactly you properties are structured.

This works if I turn the authors property into a list, thank you! I’m still looking for a solution since I’d rather not have to change the property type, but I appreciate your help :slight_smile:

If authors is text and aliases is list then this should work:

this.aliases.contains(authors)

Because authors is a string and aliases is a list, give this filter a try:

this.aliases.filter(authors.containsAny(value))