---
title: "Exporting Tables"
canonical: "https://docs.getxporter.app/space/XPORTERCLOUD/528566/Exporting%20Tables"
format: markdown
---
> Macro (rw-ui-expands-macro)
> 
> > Macro (rw-expand)
> 
> > Macro (toc)

# Introduction

[<span style="color: #172B4D">Table Grid Next Generation</span>](https://docs.getxporter.app/space/XPORTERCLOUD/558288)<span style="color: #172B4D"> mappings are based on the columns you create for your Table Grid. </span><span style="color: #0d0d0d">Each row in the Table Grid from the Jira issue corresponds to a row in the iteration, maintaining the same order as displayed in your exported Jira issue.</span>

# <span style="color: #172B4D">Exporting Tables</span>

## <span style="color: #172B4D">Definition</span>

<span style="color: #172B4D">To export the data you have in your Table Grid, use this definition:</span>

```
//You can get the number of rows contained in a Table Grid by using the following mapping
${TableGrid.TABLE_NAMECount}

#{for n=TableGrid.TABLE_NAMECount}
	// Table Grid fields will go in here.
	${TableGrid.TABLE_NAME[n].COLUMN_ID}
#{end}
```

> ⚠️ - Replace `TABLE_NAME` with your Table Grids' name.
> ⚠️ - Replace `COLUMN_ID` with the column ID. The column ID is the [Identifier](https://docs.getxporter.app/space/XPORTERCLOUD/461831/Table+Grid+Configuration#Example) used while creating the Table Grids' column. This identifier can also be verified in the list of columns present in the Table Grid between parenthesis.
> ⚠️ - To export all the columns you have in your Table Grid, add this snippet `${TableGrid.TABLE_NAME[n].COLUMN_ID}` to each column.

## Helpers

For accurate formatting of specific mappings, use the following helper scripts.

### Date Time

While exporting a column which [type](https://docs.getxporter.app/space/XPORTERCLOUD/461831/Table+Grid+Configuration#Column-Types) is *DateTime,* the time is going to be exported in seconds (epoch time). If you want to get the right format for the date and time, you can use this script:

##### **DateTime Formatting Example**

```
// Replace the TABLE_NAME with the Table Grids' name and DATETIME_COLUMN with the column id.
#{for n=TableGrid.TABLE_NAMECount}
	DateTime: %{var date = new Date(${TableGrid.TableGrid_Name[n].DATETIME_COLUMN}); date.getFullYear() + '/' + (date.getMonth() + 1) + '/' + date.getDate() + ' ' + (date.getHours() - 1) + ':' + ("0" + date.getMinutes()).slice(-2)}
#{end}

```

### Date

While exporting a column which type is *Date,* the date is going to be exported as a number (epoch time). If you want to get the right format for the date, you can use this script:

##### **Date Formatting Example**

```
// Replace the TABLE_NAME with the Table Grids' name and DATE_COLUMN with the column id.
#{for n=TableGrid.TABLE_NAMECount}
	Date: %{var date = new Date(${TableGrid.TABLE_NAME[n].DATE_COLUMN}); date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate()}
#{end}

```

### Time

While exporting a column which type is *Time*, the time is going to be exported as a number of seconds since January 1st, 1970 (epoch time). If you want to get the right format for the date, you can use this script:

##### **Time Formatting Example**

```
// Replace the TABLE_NAME with the Table Grids' name and TIME_COLUMN with the column id.
#{for n=TableGrid.TABLE_NAMECount}
	Time: %{let date = new Date(${TableGrid.TABLE_NAME[n].TIME_COLUMN}); (date.getHours() - 1) + ':'+ date.getMinutes()}
#{end}

```

### Checkbox

While exporting a column which type is *Checkbox,* you are going to receive a Boolean that can be `true` or `false`. You can format the retrieved value by using a script like this:

##### **Checkbox Formatting Example**

```
// Replace TABLE_NAME with the Table Grid's name and BOOLEAN_COLUMN with the column id.
#{for n=TableGrid.TABLE_NAMECount}
  Checkbox: %{'${TableGrid.TABLE_NAME[n].BOOLEAN_COLUMN}' ? 'Checked' : 'Not Checked' }
#{end}

```

### Attachment

While exporting a column which type is *Attachment*, you are going to receive the URL of the attachment. However, if your attachment is an image, you can export the image and not the URL, using the following script:

##### **Attachment Formatting Example**

```
// Replace the TABLE_NAME with the Table Grids' name and ATTACHMENT_COLUMN with the column id.
#{for n=TableGrid.TABLE_NAMECount}
	Attachment URL: ${TableGrid.TABLE_NAME[n].ATTACHMENT_COLUMN}
	Attachment Image: !{${TableGrid.TABLE_NAME[n].ATTACHMENT_COLUMN}}
#{end}

```

## Examples

![Figure 1 - Table Grid created in a Jira Issue](media://08d82812-6e1b-4a04-9608-be679c0dbe1d)

![Figure 2 - Result of the template with the table grid above](media://31ada4ed-f315-41d4-9698-b75add00cb91)

### Templates

The documents below show examples of how you can export your Tables Grids':

- [Single Export](https://docsxporter.atlassian.net/wiki/pages/viewpageattachments.action?pageId=528566&preview=%2F528566%2F528584%2FTableGridTemplateSingle.docx)
- [Bulk Export](https://docsxporter.atlassian.net/wiki/pages/viewpageattachments.action?pageId=528566&preview=%2F528566%2F528587%2FTableGridTemplateBulk.docx)

> ⚠️ **Template Store**
> ⚠️ 
> ⚠️ Original and sample Templates are available on the [Xporter Template Store](https://store.getxporter.app/?platf=JIRACLOUD&sort=1&order=desc). You can [install the original Template directly in Xporter](https://docs.getxporter.app/space/XPORTERCLOUD/427622/Working+with+Templates).


<details>
<summary>Support/Troubleshooting</summary>

If you have questions or technical issues, please [contact the Support team via the Customer Portal (Jira service management)](https://jira.getxray.app/servicedesk/customer/portal/2/user/login?destination=portal%2F2%2Fcreate%2F28) or [send us a message using the in-app chat](https://docs.getxporter.app/space/XPORTERCLOUD/18251779/In-App+Chat+Support).
</details>