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

> Macro (excerpt)
> 
> Enables you to display or hide certain content depending on the execution result of a certain script.

## Example

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

![image](media://9b8fdeb6-8b77-42e6-b215-e62e12c81def)

### 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 instance **HasDescendants.sil** like in the image below.
  
4. In the **HasDescendants.sil** file that you created, write the following script. It hides the table from the page if there's no data for such table.
5. Click **Check** and **Save.**

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 ConditionScriptMacro

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

1. To add a ConditionScriptMacro, go to the necessary Confluence page, click **Insert more content**, and select** ****Other macros**** ****>**** SIL condition**.  
  
> 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 **input** - space key and the page name where you want to display the variables.
  3. Select 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.
    
3. Click **Save, **to see the table is no longer displayed on the page.

#### Summary

You have created the **HasDescendants.sil **script and a **ConditionScriptMacro** that is associated with this script.

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

Every time you update a page, the macro will hide the table if there is no data for it.

## See also

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