<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Limit the Number of For Loops in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Limit-the-Number-of-For-Loops/m-p/467861#M45404</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/160494"&gt;@EJackson23&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would recommend limiting the results by 10 objects only, and you can do that like this example -&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;{% set associated_objects = crm_associations(contact_id, 'USER_DEFINED', 30, 'limit=10&amp;amp;orderBy=account_row_id', 'account_row_id,acct_uom,acct_commodity,lastmonth_date,lastmonth,thismonth_date,thismonth,month1,month1_date,month2,month2_date,month3,month3_date,month4,month4_date,month5,month5_date,month6,month6_date,month7,month7_date,month8,month8_date,month9,month9_date,month10,month10_date,month11,month11_date', false) %}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have an amazing day ahead!&lt;/P&gt;</description>
    <pubDate>Wed, 28 Jul 2021 05:32:56 GMT</pubDate>
    <dc:creator>himanshurauthan</dc:creator>
    <dc:date>2021-07-28T05:32:56Z</dc:date>
    <item>
      <title>Limit the Number of For Loops</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Limit-the-Number-of-For-Loops/m-p/467660#M45399</link>
      <description>&lt;P&gt;I'd like to limit the number of loops so it doesn't show more than 10 records. I've tried adding the range function but I'm not exactly sure where to put it. Thanks for you help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{% set contact_id = contact.hs_object_id %}&lt;/P&gt;&lt;P&gt;{% set associated_objects = crm_associations(contact_id, 'USER_DEFINED', 30, 'orderBy=account_row_id', 'account_row_id,acct_uom,acct_commodity,lastmonth_date,lastmonth,thismonth_date,thismonth,month1,month1_date,month2,month2_date,month3,month3_date,month4,month4_date,month5,month5_date,month6,month6_date,month7,month7_date,month8,month8_date,month9,month9_date,month10,month10_date,month11,month11_date') %}&lt;/P&gt;&lt;P&gt;{% for energyresi in associated_objects.results %}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All my html&lt;/P&gt;&lt;P&gt;{% endfor %}&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 20:36:21 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Limit-the-Number-of-For-Loops/m-p/467660#M45399</guid>
      <dc:creator>EJackson23</dc:creator>
      <dc:date>2021-07-27T20:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: Limit the Number of For Loops</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Limit-the-Number-of-For-Loops/m-p/467861#M45404</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/160494"&gt;@EJackson23&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would recommend limiting the results by 10 objects only, and you can do that like this example -&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;{% set associated_objects = crm_associations(contact_id, 'USER_DEFINED', 30, 'limit=10&amp;amp;orderBy=account_row_id', 'account_row_id,acct_uom,acct_commodity,lastmonth_date,lastmonth,thismonth_date,thismonth,month1,month1_date,month2,month2_date,month3,month3_date,month4,month4_date,month5,month5_date,month6,month6_date,month7,month7_date,month8,month8_date,month9,month9_date,month10,month10_date,month11,month11_date', false) %}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have an amazing day ahead!&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 05:32:56 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Limit-the-Number-of-For-Loops/m-p/467861#M45404</guid>
      <dc:creator>himanshurauthan</dc:creator>
      <dc:date>2021-07-28T05:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: Limit the Number of For Loops</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Limit-the-Number-of-For-Loops/m-p/468095#M45425</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/160494"&gt;@EJackson23&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN data-sheets-value="{&amp;quot;1&amp;quot;:2,&amp;quot;2&amp;quot;:&amp;quot;This function returns an object with the following attributes: has_more, total, offset and results.\r\nYou can pass offset number in association hubl function:\r\nScreen shot : https://prnt.sc/1gzol30\r\n\r\n\r\nPlease have look this documentation : \r\nhttps://developers.hubspot.com/docs/cms/hubl/functions\r\n\r\nExample : \r\n{% set associated_objects = crm_associations(&amp;lt;contact_vid&amp;gt;, 'USER_DEFINED', 30, 'offset=&amp;lt;offset_interger&amp;gt;', false) %}\r\n\r\nThanks !!&amp;quot;}" data-sheets-userformat="{&amp;quot;2&amp;quot;:829,&amp;quot;3&amp;quot;:{&amp;quot;1&amp;quot;:0},&amp;quot;5&amp;quot;:{&amp;quot;1&amp;quot;:[{&amp;quot;1&amp;quot;:2,&amp;quot;2&amp;quot;:0,&amp;quot;5&amp;quot;:{&amp;quot;1&amp;quot;:2,&amp;quot;2&amp;quot;:0}},{&amp;quot;1&amp;quot;:0,&amp;quot;2&amp;quot;:0,&amp;quot;3&amp;quot;:3},{&amp;quot;1&amp;quot;:1,&amp;quot;2&amp;quot;:0,&amp;quot;4&amp;quot;:1}]},&amp;quot;6&amp;quot;:{&amp;quot;1&amp;quot;:[{&amp;quot;1&amp;quot;:2,&amp;quot;2&amp;quot;:0,&amp;quot;5&amp;quot;:{&amp;quot;1&amp;quot;:2,&amp;quot;2&amp;quot;:0}},{&amp;quot;1&amp;quot;:0,&amp;quot;2&amp;quot;:0,&amp;quot;3&amp;quot;:3},{&amp;quot;1&amp;quot;:1,&amp;quot;2&amp;quot;:0,&amp;quot;4&amp;quot;:1}]},&amp;quot;7&amp;quot;:{&amp;quot;1&amp;quot;:[{&amp;quot;1&amp;quot;:2,&amp;quot;2&amp;quot;:0,&amp;quot;5&amp;quot;:{&amp;quot;1&amp;quot;:2,&amp;quot;2&amp;quot;:0}},{&amp;quot;1&amp;quot;:0,&amp;quot;2&amp;quot;:0,&amp;quot;3&amp;quot;:3},{&amp;quot;1&amp;quot;:1,&amp;quot;2&amp;quot;:0,&amp;quot;4&amp;quot;:1}]},&amp;quot;8&amp;quot;:{&amp;quot;1&amp;quot;:[{&amp;quot;1&amp;quot;:2,&amp;quot;2&amp;quot;:0,&amp;quot;5&amp;quot;:{&amp;quot;1&amp;quot;:2,&amp;quot;2&amp;quot;:0}},{&amp;quot;1&amp;quot;:0,&amp;quot;2&amp;quot;:0,&amp;quot;3&amp;quot;:3},{&amp;quot;1&amp;quot;:1,&amp;quot;2&amp;quot;:0,&amp;quot;4&amp;quot;:1}]},&amp;quot;11&amp;quot;:4,&amp;quot;12&amp;quot;:0}"&gt;This function returns an object with the following attributes: has_more, total, offset and results. &lt;BR /&gt;You can pass offset number in association hubl function: &lt;BR /&gt;Screen shot : &lt;A href="https://prnt.sc/1gzol30" target="_blank"&gt;https://prnt.sc/1gzol30&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Please have look this documentation : &lt;BR /&gt;&lt;A href="https://developers.hubspot.com/docs/cms/hubl/functions" target="_blank"&gt;https://developers.hubspot.com/docs/cms/hubl/functions&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Example : &lt;BR /&gt;{% set associated_objects = crm_associations(&amp;lt;contact_vid&amp;gt;, 'USER_DEFINED', 30, 'offset=&amp;lt;offset_interger&amp;gt;', false) %}&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P data-unlink="true"&gt;&lt;SPAN&gt;Hope this helps!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;If we were able to answer your query, kindly help the community by marking it as a solution.&lt;BR /&gt;&lt;BR /&gt;Thanks and Regards.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 13:51:46 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Limit-the-Number-of-For-Loops/m-p/468095#M45425</guid>
      <dc:creator>webdew</dc:creator>
      <dc:date>2021-07-28T13:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: Limit the Number of For Loops</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Limit-the-Number-of-For-Loops/m-p/468870#M45460</link>
      <description>&lt;P&gt;Thank you Himanshu. This worked great.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 13:04:16 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Limit-the-Number-of-For-Loops/m-p/468870#M45460</guid>
      <dc:creator>EJackson23</dc:creator>
      <dc:date>2021-07-29T13:04:16Z</dc:date>
    </item>
  </channel>
</rss>

