---
title: "Attachment Table Macro"
canonical: "https://support.appfire.com/space/TBL/74814506/Attachment%20Table%20Macro"
format: markdown
---
> Macro (div)
> 
> ### On this page
> 
> > Macro (toc)

# Overview

> Macro (excerpt)
> 
> The Attachment Table macro produces a table of attachments based on various selection criteria, including powerful space and page selection.
> 
> 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 [Columns Available to Display](#AttachmentTableMacro-ColumnsAvailableToDisplay) for details.
> 
> The resulting table can be customized and supports most [common table capabilities](https://appfire.atlassian.net/wiki/spaces/TBL/pages/74815958).

> ✅ Depending on the selection criteria used and 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.

# Feature Video

> Macro (include)

# Basic Use

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

| **Selected from the Macro Browser** | **Attachment Table** |
| --- | --- |
| **Markup Shortcut** | **{attachment-table}** |

### Screenshot

![image](media://acc4e4fa-630f-4bc7-a746-3230c0823217)

> ℹ️ **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)
> ℹ️ 
> ℹ️ ![image](media://48a65339-1e59-4827-b1b6-f7261d48a31d)

# Parameters

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

<span style="color: #000000">Refer to </span>[<span style="color: #000000">Using Regex Expressions To Select Attachments</span>](https://appfire.atlassian.net/wiki/spaces/TBL/pages/74815060)<span style="color: #000000"> to learn how to form the regular expressions that are supported by several parameters below.</span>

> Macro (table-plus)
> 
> | **Parameter** | **Default** | **Macro Browser Label** | **Description** |
> | --- | --- | --- | --- |
> | **page** | current page | Page to list attachments from | Simple way to find a single page and display it's attachments. Use a page title (in the current space) or preface the title with *SPACEKEY:* if the page is in a different space. This parameter takes precedence over the other page selection parameters. Leave blank to use **spaceRegex** and **pageRegex** instead. |
> | **spaceRegex** |  | Space key or space name regex | A [regular expression (regex)](https://appfire.atlassian.net/wiki/spaces/info/pages/86082100) pattern to match on space keys or space names. Used in combination with the **pageRegex** parameter to select pages from which attachments will be chosen. **@self** can be used to identify the current space. If **spaceRegex** is left blank, the **page** parameter is required. |
> | **includePersonalSpaces** | false | Include personal spaces | Use to determine whether personal spaces matching the **spaceRegex** should be included or not. |
> | **pageRegex** |  | Page name regex | A [regular expression (regex)](https://appfire.atlassian.net/wiki/spaces/info/pages/86082100) pattern to match on page names (titles). Used in combination with the **spaceRegex** parameter to select pages from which attachments will be chosen. |
> | **pageLabelRegex** |  | Page label regex | A [regular expression (regex)](https://appfire.atlassian.net/wiki/spaces/info/pages/86082100) pattern to match on page labels. Used in combination with the **pageRegex** and **spaceRegex** parameters to select pages from which attachments will be chosen. Pages must match all selection criteria. |
> | **attachmentRegex** |  | Attachment name regex | A [regular expression (regex)](https://appfire.atlassian.net/wiki/spaces/info/pages/86082100) pattern to match on attachment names. Used in combination with the **commentRegex** and **labelRegex** parameters to select attachments. Attachment must match all selection criteria. |
> | **commentRegex** |  | Attachment comment regex | A [regular expression (regex)](https://appfire.atlassian.net/wiki/spaces/info/pages/86082100) pattern to match on attachment comments. Used in combination with the **attachmentRegex** and **labelRegex** parameters to select attachments. Attachment must match all selection criteria. |
> | **labelRegex** |  | Attachment label regex | A [regular expression (regex)](https://appfire.atlassian.net/wiki/spaces/info/pages/86082100) pattern to match on attachment labels. Used in combination with the **attachmentRegex** and **commentRegex** parameters to select attachments. Attachment must match all selection criteria. Matching technique is determined by the **labelMatchOption** parameter. |
> | **labelMatchOption** | single | Label match option | <span style="color: #000000">Indicates the manner in which to apply the </span>**<span style="color: #000000">labelRegex</span>**<span style="color: #000000"> parameter (for attachments) and the </span>**<span style="color: #000000">pageLabelRegex</span>**<span style="color: #000000"> parameter (for pages) when looking for matching labels.</span><br>> Macro (legacy-content) |
> | **columns** | default columns | Columns to show | 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.<br>See [Columns Available for Display](#AttachmentTableMacro-ColumnsToShow) below for a list of columns. |
> | **textForNone** |  | Text to display when no attachments match | Indicates the text that should be displayed when no attachments are found that match the search criteria. |
> | **dateFormat** | Confluence default | Date format | Date format for **created** and **modified** columns. Use a [simple](http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html)[ ](http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html)[date](http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html)[ ](http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html)[format](http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html) string. |
> | **limit** | 1000 | Limit number of attachments to retrieve | Processing stops after the number of attachments found matching the selection criterial reaches the limit value. Space, page, and attachment processing is ordered by name. |

### Common Parameters

> Macro (include)


 

> Macro (anchor)



# > Macro (anchor)

Columns Available for Display

The Attachment Table macro allows the user to select the columns to be displayed as well as the order. 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 **columns** parameter to specify a comma separated list of column **names** or **numbers**.

:info: Please note that column names are case insensitive.

In most cases the **column heading** can be used in place of the **column name**, but there are a few cases where that is ambiguous. In this case, the first column matching the heading will be used. 

| **Default columns for single page attachments** | **file, size, creator, created, comment** |
| --- | --- |
| **Default columns for multiple page attachments** | **page, file, size, creator, created, comment** |

 

 

> Macro (csv)

# Examples

> Macro (contentbylabel)

# Other Macros

<span style="color: #000000">Below is a list of all other Macros available within this Add-on:</span>

> Macro (contentbylabel)

# Additional References

- [Common Table Capabilities](https://appfire.atlassian.net/wiki/spaces/TBL/pages/74815958)
- [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)