#Default value in Filter of a Query

1 messages · Page 1 of 1 (latest)

thick bison
#

I have a Query with a Filter By.

{
    "condition": "OR",
    "children": [
        {
            "condition": "EQ",
            "key": "article",
            "value": "{{ CategoryDropDown.selectedOptionValue }}"
        }
    ]
}

How can I achieve to have a wild card if there is now value in the dropdown selected?

unique caveBOT
#

You could try something like {{ CategoryDropDown.selectedOptionValue !== undefined ? CategoryDropDown.selectedOptionValue : 'your wildcard here' }}

thick bison
#

Okay, that code looks good but what can be used as wildcard for Google Spreadsheets?

Asterisk and ampersand are not working.

thick bison
#

If I try text contains = * in Google Spreadsheet it work as expected.

unique caveBOT
#

If that works, then maybe make it a contains clause instead but with the same
logic.

thick bison
#

I already changed the condition to contains but no combination with * work in my query.

#

As all values in the column started with the same word I now use the following JS expression:

{{ CategoryDropDown.selectedOptionValue ? CategoryDropDown.selectedOptionValue : 'Word' }}
unique caveBOT
#

And does this work as expected for you?

thick bison
#

Yes it does. But I think here we have a bug as known wildcards for Spreadsheet filters does not work.

unique caveBOT
thick bison