CMS Development

Ilkkamarkus
Member

HubDB | How to print rows with a specific multiselect value selected

SOLVE

Hello. 

 

I'm trying to figure out how to print rows with a specific multiselect value from a hubdb table. For now it works fine if I have just one value selected in the multiselect. When I add more values to the multiselect, this query won't work anymore. 

 

multiselect.PNG

hubdb_column.PNG

With the query above, it wont print the row with two selected values. 

 

Thank you in advance for possible solutions for this 🙂

-Ilkkamarkus

0 Upvotes
1 Accepted solution
Ilkkamarkus
Solution
Member

HubDB | How to print rows with a specific multiselect value selected

SOLVE

Hi @AntonB and thanks for the contribution. 🙂

 

I got it to work by adding "&palvelut__contains=3" 

 

My second problem with this is printing the multiselect values, a simple row.palvelut.name wont work with multiselect.

 

regards,

Ilkkamarkus

View solution in original post

0 Upvotes
2 Replies 2
AntonB
Participant

HubDB | How to print rows with a specific multiselect value selected

SOLVE

Hi @Ilkkamarkus

I think the problem is that the code is "subtracting" first choice from itself. 

So basicly HubSpot is doing "X - X ~ "&palevelut-3"" instead of "X + possible_second_choice ~ "&palevelut-3"" 

 

Have you tried to add a second queryparam into the code?

 

Something like 

{% set querypara1 = "" %}
{% set querypara2 = "" %}

{% set querypara1 ~ querypara2 ~ "&palevelut-3"%}

 

regards,

Anton

0 Upvotes
Ilkkamarkus
Solution
Member

HubDB | How to print rows with a specific multiselect value selected

SOLVE

Hi @AntonB and thanks for the contribution. 🙂

 

I got it to work by adding "&palvelut__contains=3" 

 

My second problem with this is printing the multiselect values, a simple row.palvelut.name wont work with multiselect.

 

regards,

Ilkkamarkus

0 Upvotes