I'm creating a filter that needs to cover an 'or' option, but I can't get it to work beyond the first option. Any ideas what I'm doing wrong?
{% set table = hubdb_table_rows(xxxxxxx, queryparam) %}
{% set performance = table | selectattr ("plot_status.name","equalto","Exchanged") or ("plot_status.name","equalto","Completed")
{% for row in performance %}
/* Only seems to display plots that are 'Exchanged' */
{% endfor %}
I'm don't think OR is really possibly with selectattr. Instead you'll want to create variables for each filter and then use |union to combine them (union will deduplicate any common items so if there's an item in both lists it'll only show up once in the for loop).
{% set table = hubdb_table_rows(XXXXXX) %}
{% set performance = table|selectattr("plot_status.name","equalto","Exchanged") %}
{% set performance_2 = table|selectattr("plot_status.name","equalto","Completed") %}
{% for row in performance|union(performance_2) %}
{% endfor %}
If this answer solved your question, please mark it as the solution.
I'm don't think OR is really possibly with selectattr. Instead you'll want to create variables for each filter and then use |union to combine them (union will deduplicate any common items so if there's an item in both lists it'll only show up once in the for loop).
{% set table = hubdb_table_rows(XXXXXX) %}
{% set performance = table|selectattr("plot_status.name","equalto","Exchanged") %}
{% set performance_2 = table|selectattr("plot_status.name","equalto","Completed") %}
{% for row in performance|union(performance_2) %}
{% endfor %}
If this answer solved your question, please mark it as the solution.