# Loop through crm\_objects batches

**URL:** <https://community.hubspot.com/t/loop-through-crm-objects-batches/103957>\
**Category:** CMS Development\
**Created:** [April 2, 2024, 9:10pm UTC](https://community.hubspot.com/t/loop-through-crm-objects-batches/103957 "2024-04-02T21:10:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LSeth](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/lseth/32/48165_2.png) [@LSeth](https://community.hubspot.com/u/LSeth)\
**Post date:** [April 2, 2024, 9:10pm UTC](https://community.hubspot.com/t/loop-through-crm-objects-batches/103957/1 "2024-04-02T21:10:57Z")

</div>

Hello. I am using a module on a dynamic page to display crm\_objects. Of course there is the limit on how often on a page crm\_objects can be used. How would I loop through to display them in batches? I assume I would use the has\_more and offset but can’t seem to get a loop working.

Can you also paginate the results? Thanks.

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [April 3, 2024, 5:00pm UTC](https://community.hubspot.com/t/loop-through-crm-objects-batches/103957/2 "2024-04-03T17:00:42Z")

</div>

Hi, @LSeth 👋 Thanks for your question. I’d like to invite a few community members to the conversation — hey @alyssamwilie @piersg @Anton, do you have any tips you can offer @LSeth?

Thank yo very much for taking a look! —Jaycee

---

<div class="post-metadata">

**Author:** ![Anton](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/anton/32/103167_2.png) [@Anton](https://community.hubspot.com/u/Anton)\
**Post date:** [April 4, 2024, 10:48am UTC](https://community.hubspot.com/t/loop-through-crm-objects-batches/103957/3 "2024-04-04T10:48:55Z")

</div>

Hi @LSeth,

to loop through a crm\_object you have to use the [dynamic\_page\_crm\_object\_type\_fqn](https://developers.hubspot.com/docs/cms/hubl/variables#crm-object-dynamic-pages) option and [loop/repeater](https://developers.hubspot.com/docs/cms/hubl/for-loops).

build into the template it should look something like this:

```lia-code-sample
{% if dynamic_page_crm_object_type_fqn %} {# the listing page #}
{% set object = crm_objects(dynamic_page_crm_object_type_fqn, "limit=200","put, all, your, custom, object, properties, here") %}

{% for single_object in objects.results %}
<div class="object-wrapper">
<div class="names">
{{ single_object.put }} {{ single_object.all }} {{ single_object.your }}
</div>
</div class="something">
{{ single_object.your }} {{ single_object.custom }} {{ single_object.object }}
</div>
{% if single_object.properties == "here" %}
{{ single_object.here }}
{% endif %}
{% endfor %}

{% elif dynamic_page_crm_object %} {# the detail page #}
{# layout for detail page; you can use the objects set above or add more by adding a second "set object = ..." #}
{% endif %}

```

If you’d like to categorize the listing page you could add/use a property like a dropdown/select for this (see the if statement above)

About the pagination - have to test this.

But tbh, this seems to become something that you could easily use a blog for. Write your blog listing/post templates and put your CRM objects into them.

Also - custom objects were the topic of our october DHUG. You can [watch it on YouTube](https://www.youtube.com/live/TFuZWdt4ogM?si=VVlgCGXz05UsDVP1)

best,

Anton
