Bases - filtering using properties

First, search the help docs and this forum. Maybe your question has been answered! The debugging steps can help, too. Still stuck? Delete this line and proceed.

What I’m trying to do

filter a table view using properties.
So, I have a base block that shows a table with property ‘quote’. The page containing the block has property ‘quoteMatch’. If quoteMatch is empty then the table should show all notes. If the property contains a string then the table should only show notes where the quote property contains the string in quoteMatch

Things I have tried

    filters:
      and:
        - quote.contains( if ( this.quoteMatch.isEmpty(), " ", this.quoteMatch ) )

Using a space for quote.contains() if quoteMatch is empty. Which mostly works but is less than ideal because it doesn’t allow for properties with no spaces or empty properties.

Is there a better approach?

quote and quoteMatch are text properties? If so, then how about:

filters:
  or:
    - this.quoteMatch.isEmpty()
    - quote.contains(this.quoteMatch)

Perfect. Many thanks

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.