---
title: "CSV Table macro - 8.x"
canonical: "https://support.appfire.com/space/atdc/2911505312/CSV%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">CSV Table</span>*<span style="color: #000000"> macro can import, format, and display comma-separated values (CSV) data from anywhere, by:</span>

- <span style="color: #000000">Reading the CSV data from any of these sources:</span>
  - <span style="color: #000000">Within your Confluence page.</span>
  - <span style="color: #000000">From a file residing on the Confluence server.</span>
  - <span style="color: #000000">From a global or space template.</span>
  - <span style="color: #000000">From a page attachment.</span>
  - <span style="color: #000000">From an external URL.</span>
- <span style="color: #000000">Allowing customizable delimiters, quote characters, and character encoding.</span>
- <span style="color: #000000">Supporting inclusion of Wiki Markup macros within the CSV data.</span>
- <span style="color: #000000">Combining with the </span>*<span style="color: #000000">Chart</span>*<span style="color: #000000"> macro to produce powerful data visualization.</span>
- <span style="color: #000000">Leveraging the same table styling capabilities as the </span>*<span style="color: #000000">Table Plus</span>*<span style="color: #000000"> macro.</span>

<span style="color: #000000">CSV is not a formal standard, but the best reference is </span>[The Comma Separated Value (CSV) File Format](http://www.creativyst.com/Doc/Articles/CSV/CSV01.htm)<span style="color: #000000">. The support in this macro comes close to following this pseudo-standard. This macro supports certain</span> [Common table capabilities](https://appfire.atlassian.net/wiki/spaces/atdc/pages/2911505649)<span style="color: #000000">. </span>

> ⚠️ ### Applicable upto app version 8.1:
> ⚠️ 
> ⚠️ <span style="color: #000000">To enable using HTML content with CSV data, you must enable the </span>*<span style="color: #000000">Stop encoding of html characters</span>*<span style="color: #000000"> parameter. In such a case, it is recommended to contact your administrator to use </span>*<span style="color: #000000">Macro Security for Confluence</span>*<span style="color: #000000"> with this app to provide an additional layer of security to your data and privacy.</span> <span style="color: #000000">Refer to this </span>[documentation](https://appfire.atlassian.net/wiki/spaces/CMSP) <span style="color: #000000">to for more information on the </span>*<span style="color: #000000">Macro Security for Confluence </span>*<span style="color: #000000">app.</span>
> ⚠️ 
> ⚠️ <span style="color: #000000">From app version 8.2 onwards, if the </span>*<span style="color: #000000">Stop encoding of html characters</span>*<span style="color: #000000"> parameter is enabled, use of </span>*<span style="color: #000000">Macro Security for Confluence</span>*<span style="color: #000000"> is no longer needed as the macro itself provides additional security to your data</span>

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

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


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

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

![Advanced Tables for Confluence Data Center CSV Table macro configuration](media://248b2ef8-ddd2-4e19-a4bf-ad613a7f28a2)

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

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

| **Tabs** | **Macro Editor Label** | **Default** | **Description** | **Macro parameter** |
| --- | --- | --- | --- | --- |
| **Data Source** | Method of locating CSV data | macro body | Specifies the list of options where CSV data is located. The included data follows the body data based on the location selected.<br>- **Attachment** - Data is read from the list of options selected for the following parameters:
  - **Space** - Lists all available spaces.
  - **Page **- Lists all the pages available from the selected space.  
The following options indicate:
    - *@self* - current space or page
    - *@home* - homepage of current space
    - *@parent* - parent page of current page or space
  - **Attachment** - Lists all the attachments from the selected page.<br>- **Filename** - Data is read from the input specified in the *File name* field. You can specify the file located in ***Confluence home directory/script/filename***, also subdirectories.
- **Template** - Data is read from a global page template specified in the *Name of the template* field.
- **URL** - Data is read from the *URL of CSV data*, *Username*, *Password*, and *Connection timeout* fields that are explained in the succeeding rows.
- **Profile** - Data is read from external applications such as GitLab and GitHub with a pre-defined set of parameters. If selected, you must then specify the profile (*Profiles*) and the URL (*URL of CSV data*) of the CSV file(s). Available from 8.1.0 version. | script |
| Profiles |  | Contains a list of all profiles that are configured for this instance. Appears if *Method of locating CSV data* is set to *Profile*. Available from 8.1.0 version. |  |
| URL of CSV data |  | Specifies the URL of a CSV file. If specified, the included data follows the body and script data. If a profile is specified in the *Profiles* field, enter the relative path of the actual location of the CSV file(s) here. Support for profiles is available from 8.1.0 version.<br>> ℹ️ Use of this parameter may be restricted for security reasons. See your administrator for details. | url |
| Username (if required) |  | User name for URL access via basic authentication. | user |
| Password (if required) |  | User password for URL access via basic authentication. The *Password* is encrypted and remains secure (available from version 8.6.0).<br>> ⚠️ If the first attempt fails while decrypting the password, the* CSV Table* macro initiates three retry attempts to decrypt the password. (Available since app version 8.7.1.) | password |
| Connection timeout |  | Allows setting the wait time for URL access for slower connections. Time in milliseconds. | timeout |
| File encoding |  | File encoding for an external file if different from the system default handling. Since 4.1.0. Example: UTF-8. Refer to [this article](http://en.wikipedia.org/wiki/Character_encoding) for more information. | encoding |
| **Data Format** | Column delimiter | **,** | - , (comma) - The default column separator.
- whitespace - Blanks, tabs, and other white space are used to separate columns.
- tab - A single tab character is used to separate columns.
- blanks - Blank or blanks only.
- pipe - To use pipe as a delimiter, enter the text ‘pipe’ as macro does not support pipe character(|) and throws an error message.
- other single character delimiter - may be within double quotes with some restrictions. Examples: ";" and "=" work. "|" does not. | delimiter |
| Quote character | double | The character used to represent quoted data. Quoted data may contain delimiters or new lines. Quote character data must be doubled inside a quoted string.<br>- double - Double quote character: **"**
- single - Single quote character: **'** | quote |
| **Data Settings** | Columns to display |  | Comma separated list of column names or numbers in any order. Defaults to all columns in existing order. Columns are enumerated starting at 1. | columns |
| Output format | html | Determines how the output is formatted. Use wiki to have the data in the table rendered by the wiki renderer. | output |
| Ignore trailing blank rows | On | A row is considered blank if all the columns selected by the column parameter are blank. Turn this parameter **Off** to show these blank rows. | ignoreTrailingBlankRows |
| Show non-formatted version of  generated wiki | Off | Turn this parameter **On** to show a non-formatted version of the wiki table following the formatted table. This is used to help resolve formatting issues. It can also be used to convert CSV to Confluence markup by cut and paste. | showWiki |
| Escape special wiki characters | Off | Turn this parameter **On** to allow few special characters to be escaped so that the formatting is unaffected. When wiki output is requested (*output=wiki*), some special characters (like '|', '[', ']', '{', '}') in data may cause undesirable formatting of the table. The default is false so that data that has wiki markup is handled correctly. | escape |
| Render wiki markup macros in body | Off | Turn this parameter **On** to render wiki markup macros found in the body prior to processing as CSV. This is useful to run macros from *Scripting for Confluence*, *Run CLI Actions in Confluence*, *SQL for Confluence*, or similar that can produce CSV output. | macros |
| Stop encoding of html characters | Off | Server only. Turn this parameter **On** for CSV tables that use *output=html* and have HTML content. HTML content like *<a href=http://google.com>google>* displays as a link only if this parameter is enabled. Your administrator must grant specific users or groups to use this capability using *Macro Security for Confluence*. | disableAntiXss |

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

<span style="color: #000000">See</span> [Augments](https://appfire.atlassian.net/wiki/spaces/atdc/pages/2911506473) <span style="color: #000000">for details.</span>

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

> Macro (include)

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

> Macro (children)

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

- *<span style="color: #000000">Chart</span>*<span style="color: #000000"> macro - the </span>*<span style="color: #000000">CSV Table</span>*<span style="color: #000000"> macro can be used to create data for a chart</span>
- [Beanshell macro](https://appfire.atlassian.net/wiki/spaces/SCRP/pages/73728623)<span style="color: #000000"> - can be used to generate </span>*<span style="color: #000000">CSV Table</span>*<span style="color: #000000"> macro and data as output from Java code (use </span>*<span style="color: #000000">output=wiki</span>*<span style="color: #000000">)</span>
- [Groovy macro](https://appfire.atlassian.net/wiki/spaces/SCRP/pages/73728611) <span style="color: #000000">- can be used to generate </span>*<span style="color: #000000">CSV Table</span>*<span style="color: #000000"> macro and data as output from Groovy code (use </span>*<span style="color: #000000">output=wiki</span>*<span style="color: #000000">)</span>
- [Jython macro](https://appfire.atlassian.net/wiki/spaces/SCRP/pages/73728662) <span style="color: #000000">- can be used to generate </span>*<span style="color: #000000">CSV Table</span>*<span style="color: #000000"> macro and data as output from Jython code (use </span>*<span style="color: #000000">output=wiki</span>*<span style="color: #000000">)</span>

# <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>

- [Augments](https://appfire.atlassian.net/wiki/spaces/atdc/pages/2911506473)
- [The Comma Separated Value (CSV) File Format](http://www.creativyst.com/Doc/Articles/CSV/CSV01.htm)
- [Common table capabilities](https://appfire.atlassian.net/wiki/spaces/atdc/pages/2911505649)
- [Scripting for Confluence](https://appfire.atlassian.net/wiki/spaces/SCRP)
- [Run CLI Actions in Confluence](https://appfire.atlassian.net/wiki/spaces/CCLI)
- [Beanshell macro](https://appfire.atlassian.net/wiki/spaces/SCRP/pages/73728623)
- [Groovy macro](https://appfire.atlassian.net/wiki/spaces/SCRP/pages/73728611)
- [Jython macro](https://appfire.atlassian.net/wiki/spaces/SCRP/pages/73728662)
- [How to deal with templates on Confluence 4.3 and later](https://appfire.atlassian.net/wiki/spaces/info/pages/86120194)