Variables
Variables in Zoho People Extension are used to create key-value pairs that can be accessed across components, scripts, workflows, templates, and other areas of the platform. They act as reusable data holders, allowing you to store information once and use it wherever needed within the system. Learn more about
Variables and the
Usage of Varibles in an organization.
Detailed Overview of Variables in Zoho People Extension
Unlike Zoho People variables the platform variables come with added benefits as they require higher customizability, integration capabilities, and developer control. When a variable value changes, you can run custom logic automatically (For example: Notify, adjust related settings, recall values in other modules).
Permission Categories
You can set permission on variable usage for the end users from the extension platform.
Following are the four types of permission categories:
- Read/Write: This permission makes the variable visible in the users organization, where they can view and update its value. However, if you change the value in the developer console, those updates cannot be pushed through an upgrade and won’t reflect in the users organization. Such changes apply only to new sign-ups. During future extension upgrades, you can update all other details of the variable except its value.
- Read Only: A Read Only variable is visible but cannot be modified in the users organization, and its value does not change upon upgrades from the developer console. However, except the variable value of the other variable data can be updated during the extension in the next version upgrade.
- Hidden: The Hidden variable is visible in the Developer Console for developers to manage, but it remains hidden for the end users within the user's organization. Any changes to the values of the variable in the developer console can not be upgraded to the users account. However, the changes will reflect on new sign-ups and except the variable value the other data of the variable can be updated during the extension in the next version upgrade.
- System: A System variable is visible in the Developer Console for developers to manage and remains hidden for the end users in the user's organization. Any changes to the values of the variable in the user's organization is restricted for this permission type. Changes made to the variable value in the developer console are reflected to the users account during upgrade.
Permission type | Visibility (In Developer organization) | Visibility (In Customer organization) | Value updated during extension upgrade |
READ/WRITE | Yes | Yes | No |
| READ_ONLY | Yes | Yes | No |
| HIDDEN | Yes | No | No |
| SYSTEM | Yes | No | Yes
|
- In the users organization the value of the variables can be updated via API for all the categories except the SYSTEM Permission variable.
- HIDDEN and SYSTEM permission variables cannot be used as merge fields in other components.
- Except the SYSTEM permission variable all other permission variables can have its own On Change Script function.
Variables can be used in the following contexts
- Custom Functions - Dynamically access values in code logic and calculations.
- Email Templates - Personalize messages using pre-defined variable values.
- Record Templates - Inject data dynamically when creating or displaying records.
- Mail Merge Templates - Use variables in document generation for seamless data population.
- API Integrations - Access variable values through APIs for external systems or integrations.
- On Change Script Functions - A separate custom function support. Each variable can have its own On Change script function which will be triggered when the variable value is updated.
Variables Property Packaging
Packaged Variables are the ones that are created in the Developer Console and deployed in the users organization during signup or via upgrade. The following table will explain the behaviour of such variables.
Property | Upgrade Type | Modify Access |
Variable Name | Upgradable | Developer Only |
API Name | Non - Upgradable | Non - Editable |
Description | Upgradable | Developer Only |
Variable Type | Non - Upgradable | Non - Editable |
Permission | Upgradable | Developer Only |
Grouped Under | Non - Upgradable | Non - Editable |
On Change Script Function
In the Zoho People Extension Developer Console, developers can define Change Scripts to handle logic that should be executed whenever a global variable’s value is updated in the user's organization.
How It Works
When a variable is modified, the system invokes the associated Change Script and provides both the previous and updated values to the script. This ensures that you have full context to determine what should happen as a result after the change. To support this, a predefined input object named variableMap is passed to your script. This object contains the old and new values of the variable.
Script Setup
To add a Change Script:
- Go to the Field Value - On Change tab in your desired variable configuration.
- Click Create Script.
- In the editor, use the variableMap object to access the previous and current values.
Sample Syntax
- oldValue - The value of the variable before the change.
- newValue - The value after the update.
You can use these values to build your own logic.
For example:
if (oldVal != newVal)
{
// Run custom logic here
info "Variable updated from " + oldVal + " to " + newVal;
}
Use Case:
Some examples of how you might use a Change Script:
- Recalculate dependent fields whenever a configured variable is updated.
- Notify users or admins when important settings are changed.
- Reset values or workflows when thresholds are modified.
- Update API calls or integrations that rely on global settings.
Installation Setup
- When the user installs the extension and if the extension contains any variables, the Authorize Variables tab will be displayed on the installation page.

- In this tab, variables with Read/Write and Read-Only permission types are visible. The Read-Only variables are not editable, while the user can configure the Read/Write variables directly on the installation page.
- If the user skips this step during installation, they can later edit the variable values either through the extension configuration slider or from the Variables tab inside the Developer Space.
Changes and Impacts
When global variables are added or updated in your Zoho People extension and pushed as part of a package upgrade to users organization, it's important to understand how these changes affect existing implementations.
Below is a detailed breakdown of the impact based on the type of change made to a variable.
Adding a new variable
- Introducing a new global variable through an upgrade will not interfere with any existing configurations in users organization.
- The variable becomes available for use in new workflows, scripts, or field configurations.
- Existing features and user-defined processes will continue to function the same.
- You can treat it as a clean addition, no retroactive effect on current setups.
Updating an existing variable
Changes to an existing variable may have varied levels of impact, depending on what’s modified:
Safe Modifications:
- Updating the description or name of a variable has no impact on existing references or functionality.
- These are purely cosmetic or informational changes.
Impactful Modifications:
Permission Changes - Adjusting the access level (e.g. Read/Write → Read Only, or Read/Write → Hidden) will immediately affect how that variable behaves in an user's organization.
Hidden/System variables may no longer appear in configuration UIs.
End users may lose the ability to edit values.
Value Changes - If the default value of a variable is changed in the package:
- Any script, workflow, or process depending on the old value may behave differently.
- Developers can use Change Scripts to programmatically handle these transitions.
- However, end users must manually update their custom logic to adapt to the new value.
Even a small value change could affect thresholds, conditions, or calculations relying on the old setting.
Deleting a variable
Deleting a variable is a destructive change. It can have lasting effects on your users data and configurations. Please consider the consequences carefully before proceeding, and only move forward if absolutely necessary.
Deleting a global variable is a high-impact, irreversible operation that must be done with extreme caution.
- Any process, field, script, or workflow that references the deleted variable will break.
- This may cause runtime errors, missing values, or logic failures across the extension.
- There is no automatic fallback or replacement unless explicitly coded.
Removing a variable can disrupt live user environments. Only delete variables that are obsolete, unused, and have no downstream dependencies and preferably during a major version upgrade with clear release notes.
Use case: IDfy Integration for Zoho People Extension
Consider an extension that will integrate your Zoho People extension with IDFy to perform background verifications of employees. Employee details (like Aadhaar Number, PAN, Name, DOB) are captured in employee forms. By submitting the form, the extension triggers a background verification request to IDfy via APIs. Verification results (pass/fail, status, details) are saved back to the employee record. The extension supports a custom UI widget or Web Tab where HR admins can view verification status, trigger checks, and configure integration settings.
Variables Setup
You will package variables in your extension for customers to configure and secure sensitive info.
| Variable Name | Description | Permission |
| idfy_api_key | Secret API key for IDfy | Read/Write |
| idfy_client_id | Client ID issued by IDfy | Read/Write |
| idfy_access_token | Sandbox or production | Hidden |
| idfy_refresh_token | IDfy label | Hidden |
| Dev_Contact | Developer use system variable | System |
Extension Flow
- Installation and initial setup
- User's organization installs the extension.
- On the installation page, user enters:
- idfy_client_id (read/write)
- idfy_client_secret (read/write) - Once idfy_client_secret is entered and saved, it triggers the On Change script tied to this variable.
- On Change Script for idfy_client_secret
- This script changes the permission of idfy_client_secret from Read/Write to Hidden via Variables API. This locks the secret, so users can no longer see or modify it.
- Then, the script triggers the OAuth token generation flow to request access and refresh tokens from IDfy using the client ID and secret.
- The received access_token and refresh_token are stored as new hidden variables (idfy_access_token, idfy_refresh_token) created/updated dynamically via the Variables API.
- Employee verification flow (Triggered by webtab UI)
- User's organization employees open a webtab UI to enter an employee’s details (e.g., Aadhaar number) for IDfy verification.
- When they submit, the following standalone functions are triggered.
- Reads the hidden OAuth tokens (idfy_access_token, idfy_refresh_token) variables.
- Calls the IDfy verification API using the access token.
- Processes the verification response and updates employee records
If the access token has expired, the function can use the refresh token to obtain a new access token and update the hidden variable.