CMS Development

RHenderson2
Participant

hubDB help. orderBy and show certain rows

SOLVE

I have a listing page which pulls data from a hubDB table.

 

I want to sort alphabetically (orderBy=part_number) and only show rows with a column selected as Board Level (standard_product_type=Board Level).

 

this code works:
{% for row in hubdb_table_rows(5297230, "orderBy=part_number") %}


and this code works:
{% for row in hubdb_table_rows(5297230, " standard_product_type=Board Level") %}

 

But, when put together, only the first option works and the second doesn't.
{% for row in hubdb_table_rows(5297230, "standard_product_type=Board Level", "orderBy=part_number") %}

 

How do i get both options to work in my application?

thanks in advance!

1 Accepted solution
GRajput
Solution
Recognized Expert | Platinum Partner
Recognized Expert | Platinum Partner

hubDB help. orderBy and show certain rows

SOLVE

Hi @RHenderson2 

 

I would suggest using the AND operator to combine your both conditions like this "standard_product_type=Board Level&orderBy=part_number".

 

I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thanks!




Gaurav Rajput
Director, MarTech( Growth Natives)

Book a meeting


View solution in original post

5 Replies 5
RHenderson2
Participant

hubDB help. orderBy and show certain rows

SOLVE

Hi Pam,

Thank you for your help.

yes, I will add a screenshot of what is happening.

I enter the code bu using the advanced > source code.

hubspot-how-i-enter-code.png

The next image is the code editor view. Line 6 is the code in question (highlighted red, &orderBy). After I save the module and look at it again, HubSpot changes the code to the second screen shot. (&orderBy). I haven't found away around this. Any ideas would be most helpful.

 code enteredcode entered

Upon save, here is the code which has magiclly been changed to the&.

HubSpot auto changeHubSpot auto change

 

0 Upvotes
RHenderson2
Participant

hubDB help. orderBy and show certain rows

SOLVE

Hi Gaurav,

Thank you for your response.

 

The HubSpot module is changing & to & which is very frustrating. I also tried a rich text block module in advanced source code view. Same thing. & turns into & causing code to break.

 

Have you ever come across this as well?

0 Upvotes
GRajput
Solution
Recognized Expert | Platinum Partner
Recognized Expert | Platinum Partner

hubDB help. orderBy and show certain rows

SOLVE

Hi @RHenderson2 

 

I would suggest using the AND operator to combine your both conditions like this "standard_product_type=Board Level&orderBy=part_number".

 

I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thanks!




Gaurav Rajput
Director, MarTech( Growth Natives)

Book a meeting


RHenderson2
Participant

hubDB help. orderBy and show certain rows

SOLVE

Hi Gaurav,

For my initial question, your awnser is the solution. adding the & operator works great.

 

In my case, this lead me to another topic of how I can succesfully add the code into a custom module via Design Tools. Currently HubSpot will not parse correctly via the rich text box via a webpage. thank you again!

0 Upvotes
PamCotton
Community Manager
Community Manager

hubDB help. orderBy and show certain rows

SOLVE

HI @RHenderson2 is there a specific template you are currently using? 

 

Have you tried adding in your code? This ensures that the code remains intact without breaking.  The more information, screenshots, and details you can provide, the better I can advise on the next steps.

 

Thank you,

Pam

Você sabia que a Comunidade está disponível em outros idiomas?
Participe de conversas regionais, alterando suas configurações de idioma !


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !




0 Upvotes