---
title: "Customer Portal Iterations"
canonical: "https://docs.getxporter.app/space/XPORTERCLOUD/431304/Customer%20Portal%20Iterations"
format: markdown
---
> Macro (rw-ui-expands-macro)
> 
> > Macro (rw-expand)
> 
> > Macro (toc)

# Iterating Request Attachments

Because it is not known in advance how many attachments exist in a request, you can iterate a section over all the attachments of a request. This allows you to create a table that dynamically grows according to the number of existing attachments. The notation is: `$``{for attachments}`

| <span style="color: #000000">**Attachments Fields**</span> | **Description** |
| --- | --- |
| ID | The ID of the attachment |
| Name | The name of the attachment |
| Author | The author of the attachment |
| AuthorFullName | The full name of the author of the attachment |
| Created | The date the attachment was created |
| Size | The size of the attachment |
| HumanReadableSize | The formatted size of the attachment |
| MimeType | The type of the attachment |

## Sample Code

```
#{for attachments}
   ${Attachments[n].ID}
   ${Attachments[n].Name}
   ${Attachments[n].Author}
   ${Attachments[n].AuthorFullName}
   ${dateformat("dd-MM-yyyy HH:mm:ss"):Attachments[n].Created}
   ${Attachments[n].Size}
   ${Attachments[n].HumanReadableSize}
   ${Attachments[n].MimeType}
#{end}
```

or

```
#{for <VariableName>=AttachmentsCount}
   Content and Request Mappings. Example: ${Attachments[VariableName].Field}
#{end}
```

## <span style="color: #000000">Examples</span>

<span style="color: #000000">The </span><span style="color: #000000">images below (Figures 1 and 2) demonstrate examples of a Word template that iterates over attachments.</span>

![Figure 1 - Attachments](media://b37ec1d7-7294-4fbe-8ea0-49b96ddc26f9)

<span style="color: #000000">or</span>

![Figure 2 - Attachments](media://96c6889a-9e79-4ebc-8bfd-03f50ae17dc9)

<span style="color: #000000"> The images below (Figures 3 and 4) demonstrate examples of an </span>[<span style="color: #000000">Excel template</span>](https://docs.getxporter.app/space/XPORTERCLOUD/558471)<span style="color: #000000"> that iterates over attachments.</span>

![Figure 3 - Attachments](media://eb2e264a-d6b8-4151-aae5-f72b6b81e0b0)

or

![Figure 4 - Attachments](media://05d8fde6-1180-4d14-a71f-afcb248382cc)

# Iterating Request Comments

Because it is not known in advance how many comments exist for a request, you can iterate a section over all the comments on a request. This allows you to create a table that dynamically grows according to the number of existing comments. The notation is: `$``{for comments}`

| **Comments Fields** | **Description** |
| --- | --- |
| Author | The author of the comment |
| AuthorFullName | The full name of the author of the comment |
| Body | The comment |
| Created | The date the comment was posted |
| GroupLevel | The group level of the comment |

## Sample Code

```
#{for comments}
   ${Comments[n].Author} 
   ${Comments[n].AuthorFullName} 
   ${Comments[n].Body} 
   ${dateformat("dd-MM-yyyy HH:mm:ss"):Comments[n].Created}
   ${Comments[n].GroupLevel}
#{end}
```

or

```
#{for <VariableName>=CommentsCount}
   Content and Issue Mappings. Example: ${Comments[VariableName].Field}
#{end}
```

## <span style="color: #000000">Examples</span>

<span style="color: #000000">The </span><span style="color: #000000">images below (Figures 5 and 6) demonstrate examples of a Word template that iterates over request comments.</span>

![Figure 5 - Comments](media://eda78c87-05e7-4b9d-9ba4-e7f9385d467b)

<span style="color: #000000">or</span>

![Figure 6 - Comments](media://50ac16c9-8fcb-4221-8d07-8bf8b9ef50a1)


> ℹ️ <span style="color: #000000">For a working example of this functionality, check the SampleIterations.docx template in the </span>[<span style="color: #000000">Samples Page</span>](https://store.getxporter.app/view/23)<span style="color: #000000">.</span>

<span style="color: #000000">The images below (Figures 7 and 8) demonstrate examples of an Excel template that iterates over issue comments.</span>

![Figure 7 - Comments](media://576b5ff8-3da8-4c7f-8608-eb663e0454fc)

or

![Figure 8 - Comments](media://f679f0b5-3ee7-4c4a-b219-71ff76566254)

<details>
<summary>Support/Troubleshooting</summary>

If you have questions or technical issues, please [contact the Support team via the Customer Portal (Jira service management)](https://jira.getxray.app/servicedesk/customer/portal/2/user/login?destination=portal%2F2%2Fcreate%2F28) or [send us a message using the in-app chat](https://docs.getxporter.app/space/XPORTERCLOUD/18251779/In-App+Chat+Support).
</details>