---
title: "TableScriptMacro"
canonical: "https://support.appfire.com/space/PSCONF/15305171/TableScriptMacro"
format: markdown
---
> Macro (aura-html)

> Macro (excerpt)
> 
> Enables you to display data that is generated by SIL script in a table, great for reporting.

  
Save money to generate a chart by a SIL script. You can use the following data sources: external databases, Jira, and so on. Just think about the possibilities opening here!

## Example

Let’s say, you want to display the data generated by SIL script in a table.

### 1. Writing the code

1. To create a script, go to **Confluence** **Administration** > **Add-ons > cPrime Tools**,** **and click** SIL Manager.**
2. Click the **silprograms** folder and then **New > New file**.
3. Create a new SIL file and name it, for example, **CollectDescendants.sil** like in the image below.
  
4. In the **CollectDescendants****.sil** file that you created write the following script. It represents how the TableScriptMacro uses the standard variables.   
Then click **Check** and **Save.**
5. Supporting script **Page DTO** is created. This script contains information about the following columns: **ID**, **Author**, (page)** Title**, **Created**, and **Updated**.
6. You can find more information about managing your SIL Scripts on the [SIL Manager page](https://anovaapps.atlassian.net/wiki/display/SIL/SIL+Manager).

### 2. Creating a TableScriptMacro

So, you have created a script, but before using it, you need to create a TableScriptMacro and associate the script with it.

1. To add a TableScriptMacro, go to the necessary Confluence page, click **Insert more content**, and select** ****Other macros**** ****>**** SIL table**.  
  
> Macro (inline-media-image)
2. In the displayed dialog, fill out the necessary fields:
  1. Enter the script **name** that you created.
  2. Enter the names for the **columns**.
  3. Enter the **input** - space key and the page name where you want to display the variables.
  4. Define the **separator**. In our case we used comma as a separator, and you can define another symbol. For instance, in cases where a page contains commas in the name, you might want to use period as a separator. For the TableScriptMacro, the separator is applied to both **columns** and **input** fields.
    
  5. If the **transposed** checkbox is selected, the table columns will be transposed.
    
3. Click **Save** to create a TableScriptMacro.
  

#### Summary

You have created **CollectDescendants.sil**** **script and a **TableScriptMacro** that is associated with this script.

#### <span style="color: #bd5528">Result</span>

Every time you that update a page, the macro will display data generated by the selected SIL script in a table.

> ⚠️ Let’s say, you don't have data for the table you created using the TableScriptMacro, and your table is displaying the headers only. To avoid this, you can use the [ConditionScriptMacro](https://appfire.atlassian.net/wiki/spaces/PSCONF/pages/15305133).

## See also

- [ScriptMacro](https://appfire.atlassian.net/wiki/spaces/PSCONF/pages/15304937)
- [ConditionScriptMacro](https://appfire.atlassian.net/wiki/spaces/PSCONF/pages/15305133)
- [InlineScriptMacro](https://appfire.atlassian.net/wiki/spaces/PSCONF/pages/15306476)