New Bases core plugin and meta bind

What I’m trying to do

I’m expermenting with the new bases feature and whether it can be used in my workflow and replace some dataview queries I use. Bases definitely seems much quicker and scalable for a lot of notes.

I use the meta-bind plugin a lot to filter queries in dataview, mostly using the inline input dropdown function and I was trying to achieve the same filtering in bases. I have a base which displays a load of notes pre-filtered by a “subject” property and I want to also filter by a property called “company” using a meta bind variable called “companyname”. This works fine with this logic in the filter of the base file:

contains(company, this.companyname)

I would, however like to include a way to show all results for all companies. The logic I’m trying is the following:

if(this.companyname == ‘*’, true, contains(company, this.companyname))

This logic is accepted in the filter for the bases file but doesn’t return anything when the function if true. This works in dataview, so I thought it should work here as well.

I should mention that the base file is being embedded into the file that the meta-bind selection is present.

Things I have tried

I’ve tried various different statements to “true” in the logic, for instance “contains(company, “o”)” does return all companies with that letter in their name, so wondered if there is an appropriate wildcard that can be used to return everything.

The fact the logic kind of works makes me wonder if it is a meta-bind issue and not that my syntax is out.

Any help would be great
Thanks

Quick update if anyone is following this. With the latest iteration of the catalyst version 1.9.2, the bases syntax has changed and the expression I was having trouble with now works

The revised expression changes from:

if(this.companyname == ‘*’, true, contains(company, this.companyname))

to:

if(this.companyname == ‘*’, true, company.contains(this.companyname))

The selection of “*” inside the meta bind choice dropdown now resolves to show all records.

1 Like