# Looping through a nested group

**URL:** <https://community.hubspot.com/t/looping-through-a-nested-group/76202>\
**Category:** CMS Development\
**Tags:** professional\
**Created:** [February 28, 2023, 11:20pm UTC](https://community.hubspot.com/t/looping-through-a-nested-group/76202 "2023-02-28T23:20:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LLeiberman](https://avatars.discourse-cdn.com/v4/letter/l/e5b9ba/32.png) [@LLeiberman](https://community.hubspot.com/u/LLeiberman)\
**Post date:** [February 28, 2023, 11:20pm UTC](https://community.hubspot.com/t/looping-through-a-nested-group/76202/1 "2023-02-28T23:20:52Z")

</div>

Hi guys, I am trying to loop through a field group within a field group, but can’t seem to hit the slides group to populate the slide images. I have seen some forums online doing exactly my code but mine isn’t working, any thoughts?

 ![Screen Shot 2023-02-28 at 3.22.31 PM.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/2X/4/4d62c355508b02942a38dd2147f57afd019b3ce6.jpeg)

 ![Screen Shot 2023-02-28 at 3.18.41 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/3/4/34af22942114a372dccfbe7f34c47d4807d104aa.png)

---

<div class="post-metadata">

**Author:** ![ankitparmar09](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ankitparmar09/32/64399_2.png) [@ankitparmar09](https://community.hubspot.com/u/ankitparmar09)\
**Post date:** [April 17, 2023, 1:05pm UTC](https://community.hubspot.com/t/looping-through-a-nested-group/76202/2 "2023-04-17T13:05:55Z")

</div>

Hello @LLeiberman

Yes, it can have achievable. Try the following code.

**=\> Module field structure:**

 ![ankitparmar09_0-1681736639790.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/f/0/f05c74b51215284f9bd91667335a16f2b2516705.png)

**=\> Structure code:**

`{# Start Parent Group Repeater loop #}{% for item in module.parent_group %}<div class="parenter-group">{# START: Child repeater group loop #}{% for item2 in item.slider %}<div class="child-group">{% if item2.slider_image.src %}{% set sizeAttrs = 'width="{{ item2.slider_image.width }}" height="{{ item2.slider_image.height }}"' %}{% if item2.slider_image.size_type == 'auto' %}{% set sizeAttrs = 'width="{{ item2.slider_image.width }}" height="{{ item2.slider_image.height }}" style="max-width: 100%; height: auto;"' %}{% elif item2.slider_image.size_type == 'auto_custom_max' %}{% set sizeAttrs = 'width="{{ item2.slider_image.max_width }}" height="{{ item2.slider_image.max_height }}" style="max-width: 100%; height: auto;"' %}{% endif %}{% set loadingAttr = item2.slider_image.loading != 'disabled' ? 'loading="{{ item2.slider_image.loading }}"' : '' %}<img src="{{ item2.slider_image.src }}" alt="{{ item2.slider_image.alt }}" {{ loadingAttr }} {{ sizeAttrs }}>{% endif %}</div>{% endfor %}{# ENd: Child repeater group loop #}</div>{% endfor %}{# End: Parent Group Reppeater loop #}`

 ![image.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/3X/a/0/a0669cb6faf9ee161ec3e1186a9847b3fc3713b7.jpeg)
