> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://support.pdfgeneratorapi.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Is it possible to conditionally hide a page in the document?

Yes, it is possible to conditionally hide a page in a document. By using specific conditions, you can set up your document to automatically exclude certain pages. This feature helps streamline your document creation process, ensuring that only relevant content is included based on the conditions you define.

${frame}[Hide page based on condition](https://www.loom.com/embed/6e0bb26db6ed4733b3647d7043d5d68c?sid=6208955b-6c89-4c16-994a-bdfd67d2fad2)

### How to hide a page based on a condition

To hide a page when the data matches a condition, set up Conditional formatting on the page:

1. Right-click an empty area of the page and select **Conditional formatting**.
2. Under **Hide page if matches the condition**, select the **Data field** and the **Operator**, enter the **Value**, and click **ADD**.
3. To set more than one condition for the same page, click **Add new conditional rule** and fill in the next condition.

||| **Important:** When adding multiple conditions, the page is hidden if any of them is met (**OR**). To hide the page only when all conditions are met, select the **Expression** option from the operators field and use the **AND** operator in the expression.

###### Use-case of Expression Language in Conditional Formatting

Let's imagine a use-case where you want to hide the page when both {dataFieldName} and {dataFieldName2} are empty. In this case, the expression would look like this:

`empty({dataFieldName}) && empty({dataFieldName2})`

This expression will ensure that the page is hidden if both data fields are empty. You can also find more examples of expression language [here](https://support.pdfgeneratorapi.com/en/category/expression-language-q203pa/).

| **Tip:** For simple conditions the predefined operators are enough. Use the **Expression** operator when they cannot express the condition.
---
### Related articles you may find helpful

* [How to embed editor to my application?](https://support.pdfgeneratorapi.com/en/article/how-to-embed-editor-to-my-application-tmxkg5/)
* [Is it possible to conditionally change the component style or hide the component?](/en/article/is-it-possible-to-conditionally-change-the-component-style-or-hide-the-component-z8nmwg/)
* [Supported operators](https://support.pdfgeneratorapi.com/en/article/supported-operators-1g0y3zu/)