Showing or hiding pages based on a condition
You may want to show or hide certain pages in your PDF based on some condition (for example the user's role). You can use URL parameters and conditions to do this.
In the below example, we've designed a PDF on the 'test-quote' page of our app. There are 5 separate sections (or pages) to our PDF. We're using a separate group (and 1 repeating group) for each of the pages.
Each user in our app has a 'role'. They can be either an 'Admin' or a 'Customer':
Let's say we only want the 'Group - Signature' page to appear in our PDF if the user creating the PDF is an 'admin'. This is the 'Group - Signature' page:
We can control the visibility of this group by adding a URL parameter to the 'page' field in the 'Create PDF' action.
In the above image, if the current user has an 'admin' role, the 'Page Name' is going to be:
test-quote?admin=yes
If the current user is a 'customer', the 'Page Name' is going to be:
test-quote?admin=no
We can use the URL parameter to show/hide the 'Group - Signature' page in your PDF. Click on the relevant group and add a condition like the following:
Make sure you check the 'collapse when hidden' option on the group:
Now when we create the PDF as a user with the 'Customer' role, the signature page does not appear in the PDF:
But when we create the PDF as a user with the 'Admin' role, the signature page does appear:
Note: the showing / hiding of pages in your PDF does NOT have to be related to the user's role. You can use any condition you want and link it to a URL parameter.