---
title: "Attachment Table macro - 8.x"
canonical: "https://support.appfire.com/space/atdc/2911505527/Attachment%20Table%20macro%20-%208.x"
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 powerful space and page selection.</span>

<span style="color: #000000">Further customization is possible by specifying filters to select attachments by name, comment content, and labels. You can select and indicate the order in which columns are to be displayed based on their column name or number. Refer to</span> [Columns available to display](https://appfire.atlassian.net/wiki/spaces/atdc/pages/2911505527/Attachment+Table+macro+-+8.x#ColumnsToShow) <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/spaces/atdc/pages/2911505649)<span style="color: #000000">.</span>

> ✅ 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 [Cache macro](https://appfire.atlassian.net/wiki/spaces/CACHE/pages/66586270) to limit the number of times the attachment list generation needs to be done and/or the [Future macro](https://appfire.atlassian.net/wiki/spaces/CACHE/pages/66585063) to defer processing. The *limit* parameter described below can also be used to limit processing.

# <span style="color: #000000">Basic use</span>

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

| <span style="color: #000000">Selected from the macro browser</span> | *<span style="color: #000000">Advanced Tables - Attachment Table</span>* |
| --- | --- |
| ***<span style="color: #000000">Markup shortcut</span>*** | *<span style="color: #000000">{attachment-table}</span>* |

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

![Advanced Tables for Confluence Data Center Attachment Table macro displaying files](media://25438fee-dde3-436f-9cfd-c72cad56f077)

> ℹ️ ### 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 for Confluence Data Center attachment table with file thumbnails](media://8b27c313-bab0-4581-8e60-43f84f37080b)

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

<span style="color: #000000">Refer to </span><span style="color: #000000">[Use regex expressions to select attachments](https://appfire.atlassian.net/wiki/spaces/atdc/pages/2911504743)</span><span style="color: #000000"> to learn how to form the regular expressions that are supported by several parameters of the macro. </span>

> ℹ️ <span style="color: #000000">Click a column heading to toggle the sorting of that column.</span>

### **<span style="color: #000000"><u>Attachment settings</u></span>**

| <span style="color: #000000">Tabs</span> | <span style="color: #000000">Macro editor label</span> | <span style="color: #000000">Default</span> | <span style="color: #000000">Description</span> | <span style="color: #000000">Macro parameter</span> |
| --- | --- | --- | --- | --- |
| **<span style="color: #000000">Page filtering</span>** | Source | <span style="color: #000000">current page</span> | <span style="color: #000000">Select the available source of a page from which you can fetch the attachments.</span><br>- *<span style="color: #000000">Single page</span>*<span style="color: #000000">: This is the default option. Select the source </span>*<span style="color: #000000">Space</span>*<span style="color: #000000"> and </span>*<span style="color: #000000">Page</span>*<span style="color: #000000"> values from the respective drop-down lists to fetch the attachment from.</span>
- *<span style="color: #000000">Regular expression</span>*<span style="color: #000000">: Enter the respective parameter values as explained in the succeeding four rows.</span> | <span style="color: #000000">attachmentSource</span> |
| <span style="color: #000000">Filter by space key or space name</span> |  | <span style="color: #000000">Enter a</span><span style="color: #003366"> </span><span style="color: #003366">[regular expression (regex)](https://appfire.atlassian.net/wiki/spaces/info/pages/86082100)</span><span style="color: #003366"> </span><span style="color: #000000">to match with space keys or space names. Used in combination with the </span>*<span style="color: #003366">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"> - homepage 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> |
| <span style="color: #000000">Include personal spaces</span> | <span style="color: #000000">Off</span> | <span style="color: #000000">Enable to control whether personal spaces matching </span>*<span style="color: #000000">Space key or space name regex</span>*<span style="color: #000000"> are to be included or not, to process and render attachments from the specified spaces.</span> | <span style="color: #000000">includePersonalSpaces</span> |
| <span style="color: #000000">Filter by page name</span> |  | <span style="color: #000000">Enter a</span> [regular expression (regex)](https://appfire.atlassian.net/wiki/spaces/info/pages/86082100) pattern <span style="color: #000000">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> |
| <span style="color: #000000">Filter by page label</span> |  | <span style="color: #000000">Enter a </span>[regular expression (regex)](https://appfire.atlassian.net/wiki/spaces/info/pages/86082100) <span style="color: #000000">pattern</span> <span style="color: #000000">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> |
| **<span style="color: #000000">Attachment filtering</span>** | <span style="color: #000000">Attachment name regex</span> |  | <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> |
| <span style="color: #000000">Attachment comment regex</span> |  | <span style="color: #000000">Enter a</span> [regular expression (regex)](https://appfire.atlassian.net/wiki/spaces/info/pages/86082100) <span style="color: #000000">pattern</span> <span style="color: #000000">to</span> <span style="color: #000000">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> |
| <span style="color: #000000">Attachment label regex</span> |  | <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> |
| <span style="color: #000000">Label match option</span> | *<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> |
| **<span style="color: #000000">Data settings</span>** | <span style="color: #000000">Columns to display</span> | <span style="color: #000000">default columns</span> | <span style="color: #000000">Enter a comma-separated list of column names or numbers in any order. When blank, a default set of columns is shown. Columns are enumerated starting at 1.</span><br><span style="color: #000000">See</span> [Columns available for display](https://appfire.atlassian.net/wiki/spaces/atdc/pages/2911505527/Attachment+Table+macro+-+8.x#ColumnsToShow) <span style="color: #000000">below for a list of columns.</span> | <span style="color: #000000">columns</span> |
| <span style="color: #000000">Text to display when no attachments match</span> |  | <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> |
| <span style="color: #000000">Date format</span> | <span style="color: #000000">Confluence default</span> | <span style="color: #000000">Enter a date format to format the dates in the </span>*<span style="color: #000000">created</span>*<span style="color: #000000"> and </span>*<span style="color: #000000">modified</span>*<span style="color: #000000"> columns. Use a simple date format string.</span> | <span style="color: #000000">dateFormat</span> |
| <span style="color: #000000">Limit number of attachments to retrieve</span> | *<span style="color: #000000">The default value is the admin-configured value for the parameter: </span>*<br>*<span style="color: #000000">Global Configuration > Maximum attachments to process.</span>* | <span style="color: #000000">Enter the number of attachments that the macro must retrieve.The default value is the admin-configured limit for the parameter </span>*<span style="color: #000000">Maximum attachments to process </span>*<span style="color: #000000">in </span>*<span style="color: #000000">Global Configuration</span>*<span style="color: #000000">. The field description displays the admin-configured value in Global Configuration.</span><br>> ℹ️ <span style="color: #000000">Suppose the user configures a value for the parameter </span>*<span style="color: #000000">Limit number of attachments to retrieve. </span>*
> ℹ️ 
> ℹ️ - <span style="color: #000000">In that case, while processing the attachments, the macro considers the least of the value configured between the parameters </span>*<span style="color: #000000">Limit number of attachments to retrieve</span>*<span style="color: #000000">, and </span>*<span style="color: #000000">Maximum attachments to process.</span>*
> ℹ️ - <span style="color: #000000">The processing stops after the number of attachments found matching the </span>**<span style="color: #000000">Page filtering</span>**<span style="color: #000000"> selection criteria reaches the least of the value configured. For more information, refer to</span><span style="color: #ff0000"> </span><span style="color: #000000">[How to set the maximum number of attachments to process for the Attachment Table macro?](https://appfire.atlassian.net/wiki/spaces/atdc/pages/2911504821)</span>
> ℹ️ - <span style="color: #000000">The space and page attachments are processed and ordered by the attachment name and displayed on the confluence page.</span> | <span style="color: #000000">limit</span> |
| <span style="color: #000000">Retrieve attachments from child pages</span> | <span style="color: #000000">false</span> | <span style="color: #000000">Enable this option to list the child page attachments of the specified page in </span>*<span style="color: #000000">Space</span>*<span style="color: #000000"> and </span>*<span style="color: #000000">Page</span>*<span style="color: #000000"> parameters in the </span>*<span style="color: #000000">Page filtering</span>*<span style="color: #000000"> tab. By default, only the attachments on the specified page are displayed.</span><br>> ⚠️ <span style="color: #000000">This option works only if </span>*<span style="color: #000000">Single page</span>*<span style="color: #000000"> is selected in </span>***<span style="color: #000000">Page filtering > Source</span>***<span style="color: #000000">.</span> | <span style="color: #000000">fromAllChildPages</span> |

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

> Macro (include)

> Macro (anchor)



# > 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 of the attachment (based on file type or default is shown) |
| 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">The list of all other macros available within this app is as follows:</span>

> Macro (children)

# <span style="color: #000000">Additional references</span>

- [Common Table Capabilities](https://appfire.atlassian.net/wiki/spaces/atdc/pages/2911505649)
- [Cache macro](https://appfire.atlassian.net/wiki/spaces/CACHE/pages/66586270)
- [Future Macro](https://appfire.atlassian.net/wiki/spaces/CACHE/pages/66585063)
- [How to use Regular Expressions](https://appfire.atlassian.net/wiki/spaces/info/pages/86082100)
- [Simple Date Format](http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html)