...
This page demonstrates how to use the Table Plus macro, which is part of the Advanced Tables for Confluence app, to provide view users an option to downloading or exporting download or export (as an attachment) a CSV representation of the table view. By specifying the Allow download and export parameter on the macro, users are given 2 two icons () that can be clicked to download or export the current table view to a CSV file. Download places the file on the user local system and export creates an attachment.
...
title | Available with version 7.2.0 on Server unsafe-only |
---|
...
Though, a comma (,) is used as a delimiter for the table contents by default, you can specify a different character in Export file delimiter. Enter any single character to act as a delimiter in the text box. For this example, let's use the default delimiter to download the current table view.
Section | ||||
---|---|---|---|---|
|
Macro browser input
Select this macro
Macro Namename | Advanced Tables - Table Plus |
Macro Syntaxsyntax (Old editor) | {table-plus} |
Parameters/values
Table settings > Formatting > Table id | Product Revenue | |
Table settings > Advanced settings > Enable download and export as attachment | On | |
Column settings > Formatting > Column type (1 2 3) | S E I | |
Column settings > Numbering & Totaling > Insert auto number column | On | |
Column settings > Numbering & Totaling > Auto total numeric columns | On | |
Column settings > Sorting > Automatically sort in descending order | On | |
Column settings > Sorting > Automatically sort by this column | 3Macro syntax (New editor - case insensitive) | /Table Plus |
Define these parameters/values
Auto number on each row | On |
Auto total row | On |
Allow download and export | On |
Export file delimiter | , |
Sort descending | On |
Auto sort this column | 3 |
Column types | S,E,I |
Table id | Product Revenue |
Screenshot
Wiki markup input
Code Block | ||||
---|---|---|---|---|
| ||||
{table-plus:allowExport=true|id=Product Revenue|autoNumber=true|autoTotal=true|sortDescending=true|sortColumn=3|columnTypes=S,E,FF"$0,0"} || Product || On Plan || Revenue || | A | (/) | 325100 | | D | (/) | 315850 | | C | (x) | 250420 | | B | (/) | 98650 | | E | (x) | 79010 | {table-plus} |
Exported CSV
The attachment exported attachment, Product Revenue.csv exported above, can can be imported back to a Confluence page using the CSV Table Macro(Comma Separated Values) macro. This could be used for showing snapshots of tables that have been archived for a historical view. The following is like CSV Table macro with the attachment on this page:
...
CSV Table settings > Data settings > Output format | wiki |
---|---|
Row settings > Header & footer rows > Number of header rows | 1 |
CSV Table settings > Data format > Augments to data row values | , , !%3%! |
CSV Table settings > Data format > Augments to footing row values | , , Total |
CSV Table settings > Data source > Method of locating JSON data (Attachment) > Attachment | Product Revenue.csv |
Column settings > Formatting > Column type (1 2 3 4) | I S E C |
Other examples
Visit our full list of product examples for additional inspiration!