Skip to main content
Script Variables
S
Written by Sam
Updated over 7 months ago

Gorelo understands the need of multiple variable values at different level either policy or device. We now provide the user with the ability to set different values to script-level variables at runtime. The variable values can be updated at script level, policy level and device level. The priority of these values depends on from where the script is run through.

✨ Define Script variable at Script Level

  1. To define a variable and its value, go to Scripts

  2. Create a new script or go in any existing one and expand Settings from right side.

  3. Now add and provide a value to a script variable. This value since added and saved through scripts is known to be script level.

Run script on device at Script Level

  1. To execute this script on a device with the saved value, be on Add/Update Script screen.

  2. Select a device from the Device dropdown menu and click the Run button.

  3. When the script variable is triggered, it will use the value you previously saved in the script.

✨ Script Variable at Policy level

At the policy level, you may execute the script on multiple devices simultaneously, either using the same value as the script variable or by changing the value. To do so, follow these steps:

  1. Go to Policies.

  2. Choose a policy from the list where you wish to add this script.

  3. Hover over the Add icon and select the Script option.

  4. From the list of scripts, choose your desired script that has a defined script variable.

  5. A popup will appear fetching the variable value saved at script level.

    1. Choose one of the frequencies from Continuously, On Schedule or Run Once.

    2. Modify the value of the variable at policy level from here if desired.

    3. Once you have made the necessary changes, Save and Distribute the Policy.

Run script on device(s) at Policy Level

The script will auto run as per your saved frequency. Whenever this variable is called during the execution of the script the system will then follow the policy level value.

✨ Script Variable at Device level

If you have a specific device whose variable needs a different value than others, you may modify it at the device level. This action overrides the values set at the policy level and/or script level. To do so follow below steps:

  1. Go to a Device detail page

  2. Go to Policy section

  3. Click Edit button with the script.

  4. If the script is not already in the policy then hover over the Add icon and select the Script option to select your desired script with a script variable.

  5. Once you select your script, a popup will appear fetching the variable value saved at policy level.

    1. Choose one of the frequencies from Continuously, On Schedule or Run Once.

    2. Modify the value of the variable at device level from here if desired.

    3. Once you have made the necessary changes, Save and Distribute the Policy.

Run script on device at Device Level

The script will auto run as per your saved frequency. Whenever this variable is called during the execution of the script the system will then follow the device level value.

Revert Variable value

In the popup displayed at both the policy and device levels, where you can set the frequency of the script run and the variable value, there is a revert or undo button available next to the variable field box. This button reverts the value to the previous level's value.

Note:

  • The undo button clicked at device level will revert value from device to policy.

  • The undo button clicked at policy level will revert value from policy to script.

Variable value usage priority

When the script is run as per the schedule saved in the policy then the priority of the variable value usage at the time of script execution is as follows:

  • Device level value

  • Policy level value

  • Script level value

Did this answer your question?