1. What does this page cover?
Learn how to add page variables, create page script and subsequently use them inside the
pages component to populate dynamic values in the page elements upon loading your page.
2. Availability
- This feature is available in all the data centers.
- Page Scripts can be created in all the pricing plans of Creator.
- They can only be created by the super admin, admins, and developers, while other users can view them with in live mode with relevant permissions.
3. Creating Page Variables and Script
3.1 Page Script Creation Flow
3.3 Steps to Create a Page Variable

Note: If you've created page parameters previously, they'll also be counted in the 50 variables limit as mentioned above. For example, lets assume you've created 60 parameters earlier. They'll be listed in the Page Variables tab and will continue to work as per the previous configuration. However, you'll not be able to create new page variables. You need to delete the parameters to accommodate the creation of new page variables.
- Navigate to the edit mode of your application.
- Select the required page from the accordion menu in the top-left corner, or from the page preview in the middle. You'll be taken to its Design page.
- Click on the device icon to navigate to the Design view of the device of your choice.
- Hover in the middle and click Open Page Builder.
- In the page builder, click the
icon at the top. The Page Variables tab will appear.

- Click Add Variable if you're creating a variable for the first time, or click the Add New button displayed at the top-right corner of the Page Variables tab.

- Name the variable, select an appropriate data type for the new variable, and click Add.

- The variable will be added and listed in the Variables tab.


- You can search for variables using the search bar at the top.
- You need to create the page variables in the Variables tab first i.e. You cannot create variables while writing a script.
- You can sort variables in ascending or descending order in two ways: by the date on which they were added or by their data type.
3.4 Steps to Create a Page Script
1. Navigate to the
edit mode of your application.
2. Select the required page from the accordion menu in the top-left corner, or from the page preview in the middle. You'll be taken to its Design page.
3. Click on the device icon to navigate to the Design view of the device of your choice.
4. Hover in the middle and click the Open Page Builder button.
5. In the page builder, click the

icon at the top. The
Page Script and Variables tab will appear.
6. Select the Script tab and enter the required script in the Deluge code editor.

Note: Currently, you cannot perform write operations like adding or updating data using page scripts.
- empRec = Employee_LeaveDetails[Email == zoho.loginuserid];
- if(empRec.count() > 0)
- {
- img = empRec.Profile_Image;
- input.Image = "https://creatorexport.zoho.com" + zoho.appuri + "Employee_Details_Report/Image/image/" + img.getSuffix("fieldName/").getprefix("\"");
- input.Name = empRec.Name;
- input.CasualLeave = empRec.Casual_Leave;
- input.SickLeave = empRec.Sick_Leave;
- }

Note: Refer
here to get the list of Deluge tasks that are currently not supported in the code editor for page script.
7. Click
Refer Fields at the top-right of the editor to refer both variables and form fields across application.

8. Click Save to save your script.
3.5 Steps to Execute Page Script
After writing the page script, you can check if it is functioning as intended by giving any sample values for the variables.
Save the script before executing it. Then click the Execute button on the bottom right corner of the Script tab.
In the Execute pop-up that appears, enter the values for the defined page variables (ensuring that the date type matches the variable) if not assigned in the page script and click Submit.

The script will be executed with the provided values, and the result will be displayed. If any error occurs, you can debug your page script by examining the output and correcting the script as needed. To debug the script, use the info task; its output values can be viewed under Log messages section.
You can also click the Execute Again button if you want to execute the script again.

4. Limitations
- Currently, you can only create only one script (function) per page in your Creator application.
- You cannot call a script across pages inside Creator applications.
- If you had created page parameters previously, they cannot be edited (they would still continue to work according to their configuration). However, you can delete such parameters.
- You cannot call other custom functions inside the page script.
- The following Deluge tasks will not be listed while configuring the script for page script.
- Data Access
- Add records
- Update records
- Delete records
- Web Data
- postUrl
- openUrl
- Misc
- Send mail
- Sharing permissions
- Assign profile to app user
- Understand page script
- Understand pages