---
title: "Conditional Blocks"
canonical: "https://docs.getxray.app/space/XRAYCLOUD/44570587/Conditional+Blocks"
format: markdown
---
Conditional blocks allow you to show or hide sections of the document according to conditional expressions. 

It has the following notation:

##### **Expand to see the sample code**

```
#{if (%{<Javascript>})}
	CONTENT
#{end}

```

<Javascript> is a JavaScript expression that should be evaluated as true or false.

Below is a working example:

##### **Expand to see the sample code**

```
This is the header of the document. 

#{if (%{'${IssueTypeName}'.equals('Bug')})}
This section will only be visible if the issue type of the issue is Bug
This issue is a bug created by ${AssigneeUserName} with priority ${Priority}.
#{end}

#{if (%{'${Priority}'.equals('Major')})}
This section will only be visible if the priority of the issue is major.
This issue has top priority, needs to be resolved until ${DueDate}.
#{end}

#{if (%{'${escape:Description}'.equals('')})}
This issue has no description
#{end}

#{if (%{'${escape:Description}'.length > 0})}
Issue description: ${Description}
#{end}

This is the footer of the document.  
```

For more examples, check the *[Sample Conditions.docx](https://store.getxporter.app/view/20?platf=JIRACLOUD&sort=1&order=desc&keyWord=conditions)*[ Template in the ](https://store.getxporter.app/view/20?platf=JIRACLOUD&sort=1&order=desc&keyWord=conditions)[Template Store](http://www.xpand-addons.com/xporter/templatestore/).

Figure 1 demonstrates a Word Template with a conditional block:

![Figure 1 - Word template](media://47b81b52-ac87-4fa8-8703-8a940aaa6b9a)


Figure 2 demonstrates an Excel Template with a conditional block:

![Figure 2 - Excel template](media://4b764c3c-6e69-44ba-85d6-0f8fc2baaeaa)

<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://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44577312).
</details>