# How to select specific rows

**URL:** <https://community.hubspot.com/t/how-to-select-specific-rows/7659>\
**Category:** CMS Development\
**Created:** [February 4, 2018, 3:25pm UTC](https://community.hubspot.com/t/how-to-select-specific-rows/7659 "2018-02-04T15:25:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![wmflan39](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wmflan39/32/45434_2.png) [@wmflan39](https://community.hubspot.com/u/wmflan39)\
**Post date:** [February 4, 2018, 3:25pm UTC](https://community.hubspot.com/t/how-to-select-specific-rows/7659/1 "2018-02-04T15:25:34Z")

</div>

Community,

My 100-row table contains 5 groups of 20 rows each, with column types: ‘Red’, ‘Orange’, ‘Yelllow’, Green’, ‘Blue’. I wish to display only the data from the ‘Red’ row on the Red page, ‘Blue’ rows on the Blue page, etc.

Beginning with this:

{% set table\_id =\<id\> %}

{% for row in hubdb\_table\_rows(\<id\>) %}

How can I accomplish this filtering for each of the 5 pages?

Many thanks!

WmFlanigan

---

<div class="post-metadata">

**Author:** ![TRooInbound](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/trooinbound/32/89545_2.png) [@TRooInbound](https://community.hubspot.com/u/TRooInbound)\
**Post date:** [February 5, 2018, 11:00am UTC](https://community.hubspot.com/t/how-to-select-specific-rows/7659/2 "2018-02-05T11:00:28Z")

</div>

Hi @wmflan39,

you can add filter in hubdb\_table\_rows method, just like below code

```auto
{% set table_id =<id> %}
{% set queryparams = "color_name=Red" %}

{% for row in hubdb_table_rows(<id>, <queryparams>) %}

```

Hope its works for you

Team TRooInbound 🙂

---

<div class="post-metadata">

**Author:** ![wmflan39](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wmflan39/32/45434_2.png) [@wmflan39](https://community.hubspot.com/u/wmflan39)\
**Post date:** [February 5, 2018, 2:56pm UTC](https://community.hubspot.com/t/how-to-select-specific-rows/7659/3 "2018-02-05T14:56:33Z")

</div>

TRooInbound,

Thank you so much! This solves the problem (I’m no hubl nerd).

Can I combine query parameters to a) select color\_name=red AND sort by sort\_number descending?

Thanks again,

WmF

---

<div class="post-metadata">

**Author:** ![TRooInbound](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/trooinbound/32/89545_2.png) [@TRooInbound](https://community.hubspot.com/u/TRooInbound)\
**Post date:** [February 5, 2018, 4:00pm UTC](https://community.hubspot.com/t/how-to-select-specific-rows/7659/4 "2018-02-05T16:00:20Z")

</div>

Hi @wmflan39,

Yes you can do that by below code, for ascending order

`{% set queryparams = "color_name=Red&orderBy=sort_column_name" %}`

for descending order add - sign before column name

`{% set queryparams = "color_name=Red&orderBy=-sort_column_name" %}`

We hope its work for you.

Did our post help answer your query? Help the community by marking it as a solution.

Thanks,

Team TRooInbound

---

<div class="post-metadata">

**Author:** ![wmflan39](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wmflan39/32/45434_2.png) [@wmflan39](https://community.hubspot.com/u/wmflan39)\
**Post date:** [February 5, 2018, 4:12pm UTC](https://community.hubspot.com/t/how-to-select-specific-rows/7659/5 "2018-02-05T16:12:32Z")

</div>

Excellent, TRooInbound! Again, you have been very helpful.

WmF
