> For the complete documentation index, see [llms.txt](https://cranford-tech.gitbook.io/pdf-creator/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cranford-tech.gitbook.io/pdf-creator/troubeshooting/unwanted-white-spaces-when-using-nested-repeating-groups.md).

# Unwanted white spaces when using nested repeating groups

When creating PDFs of long repeating groups (i.e. when the height of the repeating group is > 1 page of the PDF), we recommend using the square bracket approach \[] outlined in [this section](/pdf-creator/tips/generating-pdfs-of-repeating-groups-that-span-multiple-pages.md) of the plugin documentation.

However, if you're creating a PDF of a **nested** repeating group you may still encounter unwanted white spaces.

The solution is to take the square bracket \[] approach and apply it to the nested repeating group. This takes a bit of extra work as you will typically have an unknown/variable number of repeating group cells that you need to add to your PDF

### Solution

The generatl approach is:

* Add ID attributes to each of the nested repeating groups
* Add square brackets ('\[' and ']') to each of those nested repeating groups

\
You can use the '**format as text**' and '**split by**' operators to get a list of the nested repeating groups. In the example below, I have a repeating group ('menucategory') with a nested repeating group ('menuitem'):<br>

<img src="https://mail.google.com/mail/u/0?ui=2&#x26;ik=3d7763e25a&#x26;attid=0.4&#x26;permmsgid=msg-a:r-2799281472094031679&#x26;th=18ec2fb99091cfb0&#x26;view=fimg&#x26;fur=ip&#x26;permmsgid=msg-a:r-2799281472094031679&#x26;sz=s0-l75-ft&#x26;attbid=ANGjdJ9aiCxDE_epSAkyC5pNLUyo01UxzUhYFznpS1XxDgF21xcwd7QVphumr9Z5kffrECcKxm1tl_WZ4I72h4rOhHTSDTWcW2wRSqDGlHpZozdl3et3bg3fN-QRw0M&#x26;disp=emb&#x26;realattid=ii_lu86njh75&#x26;zw" alt="Screenshot 2024-03-26 at 09.34.10.png" height="269" width="521">

\
I've assigned the ID attribute \[menuitem-Parent group's Menu Item's unique id] to the nested repeating group.<br>

<img src="https://mail.google.com/mail/u/0?ui=2&#x26;ik=3d7763e25a&#x26;attid=0.6&#x26;permmsgid=msg-a:r-2799281472094031679&#x26;th=18ec2fb99091cfb0&#x26;view=fimg&#x26;fur=ip&#x26;permmsgid=msg-a:r-2799281472094031679&#x26;sz=s0-l75-ft&#x26;attbid=ANGjdJ-rOjoUTaN_vvSNAsMXlq_iLa24quY3OmeeSjvmSRglOVVn4zXC3FYK_2U45LJ4-eVpGlNIl5NzRcBb-Xbgq3FPnoeItZQCsyEpoJ4SagQ8FlAwYder891epBk&#x26;disp=emb&#x26;realattid=ii_lu86rus06&#x26;zw" alt="Screenshot 2024-03-26 at 09.39.21.png" height="372" width="437">

\
Given there are two menucategory repeating groups on this page, we want to be able to dynamically get"

* \[menuitem-uniqueIDxxx]

<figure><img src="https://mail.google.com/mail/u/0?ui=2&#x26;ik=3d7763e25a&#x26;attid=0.7&#x26;permmsgid=msg-a:r-2799281472094031679&#x26;th=18ec2fb99091cfb0&#x26;view=fimg&#x26;fur=ip&#x26;permmsgid=msg-a:r-2799281472094031679&#x26;sz=s0-l75-ft&#x26;attbid=ANGjdJ_eDTLa8doUEnssABEN4Cj5Q2X9uG4mnRQysPCKZgK39HULkOMnkrl3Pd9yWTH630KElv0b22-hKiSoGMp5xApl7H4eJOGZIpqh_eob0IPrIC9M_YgwJ0j0P00&#x26;disp=emb&#x26;realattid=ii_lu86vkae7&#x26;zw" alt=""><figcaption></figcaption></figure>

* and \[menuitem-uniqueIDyyy]

<figure><img src="https://mail.google.com/mail/u/0?ui=2&#x26;ik=3d7763e25a&#x26;attid=0.2&#x26;permmsgid=msg-a:r-2799281472094031679&#x26;th=18ec2fb99091cfb0&#x26;view=fimg&#x26;fur=ip&#x26;permmsgid=msg-a:r-2799281472094031679&#x26;sz=s0-l75-ft&#x26;attbid=ANGjdJ9VSXwSSBAnB2s0FHqeIAmNl8bx6w9-5QJ7TkcEOn8MjBXxSb6xjdrPGzMWT4hvwHi35Rv83bEhEb5XSb-GFEnE84LqZiCpNrEMzu8QIVQyZpzvwYaZ-Ak1WkE&#x26;disp=emb&#x26;realattid=ii_lu86vtw98&#x26;zw" alt=""><figcaption></figcaption></figure>

\
We can use the following dynamic expression to get that:<br>

<figure><img src="https://mail.google.com/mail/u/0?ui=2&#x26;ik=3d7763e25a&#x26;attid=0.3&#x26;permmsgid=msg-a:r-2799281472094031679&#x26;th=18ec2fb99091cfb0&#x26;view=fimg&#x26;fur=ip&#x26;permmsgid=msg-a:r-2799281472094031679&#x26;sz=s0-l75-ft&#x26;attbid=ANGjdJ-kaO1JWyGGA-nPOe0AMk_ZNf_pxIQPm6oyagDQfBmWO6vnnrvFsKxX49iAW6JNRa2iyX6HFJ-ef9BFIUWZ1rIEdObcdUfyPAEedASGtMjQFPgRj1Q5T78TBWQ&#x26;disp=emb&#x26;realattid=ii_lu86wy6e9&#x26;zw" alt=""><figcaption></figcaption></figure>

\
Where the 'format as text:' is the following:<br>

<figure><img src="https://mail.google.com/mail/u/0?ui=2&#x26;ik=3d7763e25a&#x26;attid=0.5&#x26;permmsgid=msg-a:r-2799281472094031679&#x26;th=18ec2fb99091cfb0&#x26;view=fimg&#x26;fur=ip&#x26;permmsgid=msg-a:r-2799281472094031679&#x26;sz=s0-l75-ft&#x26;attbid=ANGjdJ9IBm7taHdigoW37S6UQmxOiphoxSsBlmfE59fF06_jsyxtRj0DWETiV_XJGAjvE5s_L9qX-s1rRnOL35_TBE-Hy37vqx-yRg2dvccmK3kc3G291OUAPm7GjOw&#x26;disp=emb&#x26;realattid=ii_lu86xhk210&#x26;zw" alt=""><figcaption></figcaption></figure>

and we use a comma for the 'split by'.<br>

By adding this expression to our 'Generate PDF Creator' action, we can target all of the relevant nested repeating groups without knowing how many of them there will be.<br>

<figure><img src="https://mail.google.com/mail/u/0?ui=2&#x26;ik=3d7763e25a&#x26;attid=0.8&#x26;permmsgid=msg-a:r-2799281472094031679&#x26;th=18ec2fb99091cfb0&#x26;view=fimg&#x26;fur=ip&#x26;permmsgid=msg-a:r-2799281472094031679&#x26;sz=s0-l75-ft&#x26;attbid=ANGjdJ8GGo-wugcNEdcw5UXTaa2aQws0ZREKrcSAiTkbeH-CcnSB6CuQEiCUhpE9JNqvFCwHVMxqEqcvajw43iXUnZ-ab8hzhKOXWkYpB2sWMlUTtRPcJ5itJo3BdtQ&#x26;disp=emb&#x26;realattid=ii_lu870eql11&#x26;zw" alt=""><figcaption></figcaption></figure>

You can see the setup used in the above example [here](https://bubble.io/page?type=page\&name=nested-rg-example\&version=test\&id=pdf-creator-demo\&tab=tabs-1).<br>
