Tables: apply filters and JavaScript
I have a table a column called Group that has values like 1, 1a, 1b, 2, 3, 3a, 3b. I want to filter on any rows where Group starts with 1.
I'm using Tables: apply filters and I thought I could use JavaScript in the Advanced filter logic. I have tried the following and none seem to work.
columns['Group'].charAt(0) == 1; columns['Group'].charAt(0) == '1'; columns['Group'].includes(1) == true; columns['Group'].includes(1) == 1; columns['Group'].includes('1') == true; columns['Group'].includes('1') == 1;
Can anyone spot what I'm doing wrong?
Side note: I realize that a workaround is to add a column, use Tables: apply formulas, then filter on that. But I'd like to avoid having to use multiple actions when I think in theory I can just use JS in the Tables: apply filters action.
Answers
-
@Tom_161697 The Advanced filter logic in the Tables: Apply Filters action does not support full JavaScript. You can see the operators that are currently supported here: https://help.catalytic.com/docs/tables-apply-filters/#advanced-filter-logic
Your side note is exactly correct. The best approach to this would be to add a column to the table, use the Tables: Apply formulas to columns action, and then filter on the new column.
0