---
title: "Attachment Table macro - Cloud"
canonical: "https://support.appfire.com/space/TBL/74812217/Attachment%20Table%20macro%20-%20Cloud"
format: markdown
---
> Macro (aura-html)

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

<span style="color: #000000">The </span><span style="color: #000000">*Attachment Table*</span><span style="color: #000000"> macro produces a table of attachments based on various selection criteria, including space and page selection.</span>

<span style="color: #000000">Further customization is possible by specifying filters to select attachments by name, </span><span style="color: #000000">comments</span><span style="color: #000000">, and labels. You can select and indicate the order of the </span><span style="color: #000000">columns in the table</span><span style="color: #000000"> to be displayed based on column name or number. Refer to the</span> [Columns available to display](https://appfire.atlassian.net/wiki/spaces/TBL/pages/74812217/Attachment+Table+macro+-+Cloud#atCld_attach_colsToDisplayColumnsavailablefordisplay) <span style="color: #000000">section</span> <span style="color: #000000">for details.</span>

<span style="color: #000000">The resulting table can be customized and supports most</span> [common table capabilities](https://appfire.atlassian.net/wiki/x/06B1B)<span style="color: #000000">.</span>

> ✅ <span style="color: #000000">Depending on the selection criteria used and a number of attachments, pages, and spaces that need to be processed, this could be a long running process. Choose your selection criteria carefully and consider using the </span><span style="color: #000000">*Limit number of attachments to retrieve*</span><span style="color: #000000"> parameter described below to limit processing.</span>

# Basic use

<span style="color: #000000">This macro can be added to a page using any of the following methods:</span>

| **Select from the macro browser (Insert elements)** | <span style="color: #000000">*Attachment Table*</span><br>![Insert Attachment Table macro using Insert elements](media://93e244c1-3772-4758-ba1a-acf4082973b7) |
| --- | --- |
| **Markup shortcut (New editor - case insensitive)** | <span style="color: #000000">*/Attachment Table*</span><br>![Insert Attachment Table macro using macro shortcut](media://41197c51-82ce-47b3-bc8a-6b1fd36f73ea) |

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

> ℹ️ ### See a live site creatively using the attachment-table macro
> ℹ️ 
> ℹ️ From [vxvista.org](http://vxvista.org): [Recorded Webinars](https://www.vxvista.org/display/vx4Learn/Recorded+Webinars)
> ℹ️ 
> ℹ️ ![Advanced Tables Attachment Table macro showing attachment table output](media://dcac274d-f18f-4223-ade9-0db060bd44b9)

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

The macro parameters are categorized into various tabs, such as **Structure and Data**, **Sort** **and Filter**, **Style**, and **Export**.

![Attachment Table macro configuration.jpg](media://4043a0c5-763c-46fa-b1d2-2f71199c10ec)

> ⚠️ <span style="color: #000000">Refer to </span><span style="color: #000000">[How to use regex expressions to select attachments](https://appfire.atlassian.net/wiki/x/6Ip1B)</span><span style="color: #000000"> to learn how to form the regular expressions with the parameters. </span>

## <span style="color: #000000">Macro specific parameters</span>

| Tab | Macro Editor Label | Default | Description | Macro Parameter |
| --- | --- | --- | --- | --- |
| <span style="color: #000000">Structure and Data</span> | Page to list attachments from | <span style="color: #000000">Most recent attachment uploaded to the current page</span> | <span style="color: #000000">Enter the location where the attachments are available. The following locations are supported:</span><br>- <span style="color: #000000">*page*</span><span style="color: #000000"> - Data is read from an attachment to the page specified here; provided that </span><span style="color: #000000">*page*</span><span style="color: #000000"> is in the same space as the macro.</span>
- <span style="color: #000000">*space:page*</span><span style="color: #000000"> - Data is read from an attachment to the specified </span><span style="color: #000000">*page*</span><span style="color: #000000"> that is in the specified </span><span style="color: #000000">*space*</span><span style="color: #000000">.</span> |  |
| Include personal spaces | false | Enable to control whether personal spaces matching *Space key or space name regex* are to be included or not, to process and render attachments from the specified spaces. | includePersonalSpaces |
| Retrieve attachments from child pages | false | Enable this option to list the child page attachments of the specified page in *Space* and *Page* parameters in the *Page filtering *tab. By default, only the attachments on the specified page are displayed.<br>> ⚠️ This option works only if *Single page* is selected in ***Page filtering > Source***. | fromAllChildPages |
| Limit number of attachments to retrieve | *1000* | Enter the number of attachments that the macro must retrieve in total. Processing stops after the number of attachments found matching the selection criteria reaches the limit value. Space, page, and attachment processing is ordered by attachment name. | limit |
| Space key or space name regex |  | <span style="color: #000000">Enter a </span>[regular expression (regex)](https://appfire.atlassian.net/wiki/spaces/info/pages/86082100) <span style="color: #000000">pattern to match with space keys or space names. Used in combination with the </span><span style="color: #000000">*Page name regex*</span><span style="color: #000000"> parameter to select pages from which attachments are to be chosen. If left blank, the </span><span style="color: #000000">*Page to list attachments from*</span><span style="color: #000000"> parameter is required.</span><br><span style="color: #000000">The following options indicate:</span><br>- <span style="color: #000000">*@self*</span><span style="color: #000000"> - current space or page</span>
- <span style="color: #000000">*@home*</span><span style="color: #000000"> - home page of current space</span>
- <span style="color: #000000">*@parent*</span><span style="color: #000000"> - parent page of current page or space</span><br>> ⚠️ <span style="color: #000000">It is possible that in page preview, before publishing for the first time, the result for </span><span style="color: #000000">*@self*</span><span style="color: #000000"> and </span><span style="color: #000000">*@parent*</span><span style="color: #000000"> are not displayed as expected. Once you save the document, you can view the result as expected.</span> | <span style="color: #000000">spaceRegex</span> |
| Page name regex |  | <span style="color: #000000">Enter a </span>[regular expression (regex)](https://appfire.atlassian.net/wiki/spaces/info/pages/86082100)<span style="color: #000000"> pattern to match on page names (titles). Used in combination with the </span><span style="color: #000000">*Space key or space name regex*</span><span style="color: #000000"> parameter to select pages from which attachments are to be chosen.</span> | <span style="color: #000000">pageRegex</span> |
| Page label regex |  | <span style="color: #000000">Enter a</span><span style="color: #333333"> </span>[regular expression (regex)](https://appfire.atlassian.net/wiki/spaces/info/pages/86082100)<span style="color: #333333"> </span><span style="color: #000000">pattern to match on page labels. Used in combination with the </span><span style="color: #000000">*Page name regex*</span><span style="color: #000000"> and </span><span style="color: #000000">*Space key or space name regex*</span><span style="color: #000000"> parameters to select pages from which attachments are to be chosen. Pages must match with every selection criteria.</span> | <span style="color: #000000">pageLabelRegex</span> |
| Attachment name regex |  | <span style="color: #000000">Enter a</span> [regular expression (regex)](https://appfire.atlassian.net/wiki/spaces/info/pages/86082100) <span style="color: #000000">pattern to match on attachment names. Used in combination with the </span><span style="color: #000000">*Attachment comment regex*</span><span style="color: #000000"> and </span><span style="color: #000000">*Attachment label regex*</span><span style="color: #000000"> parameters to select attachments. Attachment must match with every  selection criteria.</span> | <span style="color: #000000">attachmentRegex</span> |
| Attachment comment regex |  | <span style="color: #000000">Enter a</span> [regular expression (regex)](https://appfire.atlassian.net/wiki/spaces/info/pages/86082100) <span style="color: #000000">pattern to match on attachment comments. Used in combination with the </span><span style="color: #000000">*Attachment name regex*</span><span style="color: #000000"> and </span><span style="color: #000000">*Attachment label regex*</span><span style="color: #000000"> parameters to select attachments. Attachment must match with every selection criteria.</span> | <span style="color: #000000">commentRegex</span> |
| Attachment label regex |  | <span style="color: #000000">Enter a</span> [regular expression (regex)](https://appfire.atlassian.net/wiki/spaces/info/pages/86082100) <span style="color: #000000">pattern to match on attachment labels. Used in combination with the </span><span style="color: #000000">*Attachment name regex*</span><span style="color: #000000"> and </span><span style="color: #000000">*Attachment comment regex*</span><span style="color: #000000"> parameters to select attachments. Attachment must match with every selection criteria. Matching technique is determined using the </span><span style="color: #000000">*Label match option*</span><span style="color: #000000"> parameter.</span> | <span style="color: #000000">labelRegex</span> |
| Label match option | <span style="color: #000000">*single*</span> | <span style="color: #000000">Specify the manner in which to apply the </span><span style="color: #000000">*Attachment label regex*</span><span style="color: #000000"> parameter (for attachments) and the </span><span style="color: #000000">*Page label regex*</span><span style="color: #000000"> parameter (for pages) when looking for matching labels. The options are:</span><br>- <span style="color: #000000">*single*</span><span style="color: #000000">: An attachment, that has at least one label that matches the </span><span style="color: #000000">*Page label regex*</span><span style="color: #000000"> or </span><span style="color: #000000">*Attachment label regex*</span><span style="color: #000000"> pattern, is considered as selected.</span>
- <span style="color: #000000">*all*</span><span style="color: #000000">: </span><span style="color: #000000">*Page label regex*</span><span style="color: #000000"> and </span><span style="color: #000000">*Attachment label regex*</span><span style="color: #000000"> are used to match a blank separated list of all labels.</span> | <span style="color: #000000">labelMatchOption</span> |
| Date format | Confluence default | Enter a date format to format the dates in the *created* and *modified* columns. Use a simple date format string. | dateFormat |
| <span style="color: #000000">Style</span> | Text to display when no attachments match |  | <span style="color: #000000">Enter the text to be displayed when no attachments are found that match the given search criteria. If left blank, no text is displayed if no attachments are found.</span> | <span style="color: #000000">textForNone</span> |

## Common parameters

> Macro (include)

# > Macro (anchor)

<span style="color: #000000">Columns available for display</span>

<span style="color: #000000">The </span><span style="color: #000000">*Attachment Table*</span><span style="color: #000000"> macro allows the user to select the columns to be displayed as well as the order in which the columns are to be displayed. A default set of columns is displayed unless an explicit list is provided. You can select and indicate the order in which columns are to be displayed based on their column name or number. Use the </span><span style="color: #000000">*columns*</span><span style="color: #000000"> parameter to specify a comma separated list of column names or numbers.</span>

> ℹ️ <span style="color: #000000">The column names are case insensitive.</span>

<span style="color: #000000">In most cases, the column heading can be used instead of the column name, but there are a few cases where that is ambiguous. In such a case, the first column matching the heading is used. </span>

| <span style="color: #000000">Default columns for single page attachments</span> | <span style="color: #000000">**file, size, creator, created, comment**</span> |
| --- | --- |
| <span style="color: #000000">Default columns for multiple page attachments</span> | <span style="color: #000000">**page, file, size, creator, created, comment**</span> |

| Column Number | Column Name | Column Heading | Description |
| --- | --- | --- | --- |
| 1 | page | Page | Link to page the attachment is on |
| 2 | file | File | File link to download or view |
| 3 | size | Size | Size of attachment in bytes |
| 4 | creator | Creator | User link to who added the attachment |
| 5 | created | Created | When the attachment was added |
| 6 | comment | Comment | Descriptive comment about the attachment |
| 7 | labels | Labels | Attachment labels |
| 8 | version | Version | Version number |
| 9 | type | Type | Type of attachment - simple name |
| 10 | mimetype | Mime Type | Technical mime type name |
| 11 | size2 | Size | Size of attachment in KB or MB |
| 12 | modifier | Modifier | User link to who modified attachment properties |
| 13 | modified | Modified | When attachment properties were modified |
| 14 | id | Id | Confluence content id |
| 15 | space | Space | Key of the space containing the attachment |
| 16 | spacename | Space | Name of the space containing the attachment |
| 17 | pagetitle | Page | Title of the page containing the attachment |
| 18 | filename | File | File name of the attachment (not a link) |
| 19 | thumbnail | Thumbnail | Thumbnail image when the attachment is an image |
| 20 | image | Image | Image when the attachment is an image |
| 21 | location | Location | Link to the location on the page attachments list for the attachment |
| 22 | properties | Properties | Link to the attachment properties display for the attachment |

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

> Macro (children)

# <span style="color: #000000">Other macros</span>

<span style="color: #000000">Below is a list of all other macros available within this app:</span>

- <span style="color: #000000">[Table Plus macro](https://appfire.atlassian.net/wiki/x/fox1B)</span>
- <span style="color: #000000">[CSV (Comma Separated Values) macro](https://appfire.atlassian.net/wiki/x/4It1B)</span>
- [JSON Table macro](https://appfire.atlassian.net/wiki/x/nIt1B)