CMS Development

SirHubalot
Member

HubDB Not Equals Filter On Multiple Values

SOLVE

Hi,

 

I have a value in a variable that contains comma-separeted values of category names.

 

What I would like to do is pass this to my HubDB filter query to get back a list of records where those categories are not equal to the data.

 

Would be the approach of doing this?

 

{% set categories = "Category1, Category2, Category3" %}
{% set unused_categories = hubdb_table_rows(99999,"name__ne="~categories~"&orderBy=name") %}

 

Thanks for any help!

 

0 Upvotes
1 Accepted solution
Kevin-C
Solution
Recognized Expert | Partner
Recognized Expert | Partner

HubDB Not Equals Filter On Multiple Values

SOLVE

Hey @SirHubalot 

 

You could use not_like just as you would contains, by passing it a comma separated values:

 

{% set categories = "Category1, Category2, Category3" %}
{% set cats = 'multiselect__not_like='~categories|join(',')%}
{% set table = hubdb_table_rows(XXXXXX, cats) %}

 

 

Hope this get ya going!

Kevin Cornett - Sr. Solutions Architect @ BridgeRev

View solution in original post

2 Replies 2
Kevin-C
Solution
Recognized Expert | Partner
Recognized Expert | Partner

HubDB Not Equals Filter On Multiple Values

SOLVE

Hey @SirHubalot 

 

You could use not_like just as you would contains, by passing it a comma separated values:

 

{% set categories = "Category1, Category2, Category3" %}
{% set cats = 'multiselect__not_like='~categories|join(',')%}
{% set table = hubdb_table_rows(XXXXXX, cats) %}

 

 

Hope this get ya going!

Kevin Cornett - Sr. Solutions Architect @ BridgeRev
dennisedson
HubSpot Product Team
HubSpot Product Team

HubDB Not Equals Filter On Multiple Values

SOLVE

@Chris-M , @Jake_Lett , @webdew , can any of you offer @SirHubalot some guidance?

0 Upvotes