The ‘Field & Form Rules’ is a great new feature for Request templates in ManageEngine ServiceDesk Plus. The feature allows for the creation of dynamic forms that change in response to selection of field values and content.
 
 
 
 
 
FieldForm1
 
 
 
 
 
Whilst there are standard actions that can be defined for a Field and Form Rule, such as Enable / Show / Hide / Mandate fields, there is also an ‘Action’ option to ‘Execute Script’ which allows for even further customisation.
 
 
 
 
 
 
FieldForm2
 
 
 
 
 
 
 
 
Now Zoho have a couple of sample scripts, one of which a number of customers have wanted to use, namely the ‘Dependency Example’. However, the example given involves three related fields and is not immediately clear regarding its operation even with the details provided in the on-line help. Generally we’re looking to define two related fields rather than three so I thought I’d add a few notes to assist anyone looking to use this feature.
 
To test a dependency script create a new test Incident template create a couple of ‘Pick List’ custom fields on this template, e.g. First Pick List with options Option 1, Option 2 and Option 3 and Second Pick List with options Option A, Option B and Option C :
 
 
 
FieldForm3
FieldForm4
 
 
 
 
 
 
Next create a new Field and Form Rule for an ‘On Form Load’ action with an ‘Action’ of ‘Execute Script’ and click the option to ‘Write Script’ (no condition is necessary on the rule). In the pop-up editor paste the following script code and save.
var dependencyObj= {
    “FIELDS” :[“First Pick List”,”Second Pick List”],
    “VALUES”:{
        “Option 1”:[“Option A”,”Option B”,”Option C”],
        “Option 2”:[“Option A”,”Option B”],
        “Option 3”:[“Option C”]
    }
};
$CS.setFieldDependency(dependencyObj);
 
Next enter a request using this test Incident Template and check your dependency fields, you should see that the values of the ‘Second Pick List’ field will change dependent on the value of the ‘First Pick List’ field, in the example choosing ‘Option 1’ gives the two selections ‘Option A & Option B’ rather than all three:
 
 
FieldForm5
 
 
 
Cool huh? 
 
Few things to note:
  • In the script use the unique alias name or label you used to define the field (ServiceDesk Plus has it’s own internal naming convention for these fields).
  • Make sure you define all the options needed in the dependent field(s), in our example the ‘Second Pick List’ field.
  • It should be noted that these are scripts saved in the rule itself. They are not external scripts such as PowerShell or Python. The script should be valid JavaScript code in order to execute. 
  • Need three related fields? Try the format of the extended script below using a third dependent pick list (don’t forget to create the custom field and add it to your test Incident template):

 

var dependencyObj= {
    “FIELDS” :[“First Pick List”,”Second Pick List”,”Third Pick List”],
    “VALUES”:{
        “Option 1”:{
             “Option A”:[“Option i”,”Option iv”],
             “Option B”:[“Option iii”],
             “Option C”:[“Option i”]
        },
        “Option 2”:{
             “Option A”:[“Option ii”,”Option iii”],
             “Option B”:[“Option i”]
       },
        “Option 3”: {}       /* no sub selections
    }
};
$CS.setFieldDependency(dependencyObj);
 
Enjoy!
This article is relevant to:
Service Desk

You may be interested in these other recent articles

Migrating to ServiceDesk Plus Cloud: What Moves, What Doesn’t

19 May 2026

Migrating from ServiceDesk Plus on-premise to the cloud edition is not a straightforward lift-and-shift. The two versions share similar functionality but differ significantly under the…

Read more

Protected: Test: Quote Form

15 May 2026

There is no excerpt because this is a protected post.

Read more

Endpoint Central Disk Space Reports: Getting the Data You Actually Need

13 May 2026

If you’ve ever tried to set up a useful disk space report in ManageEngine Endpoint Central, you’ll know the built-in options can leave a bit…

Read more

Latest Updates for ManageEngine Endpoint Central

7 May 2026

Discover the latest Endpoint Central updates, including new features, fixes, and enhancements.

Read more

Automatically Creating Notes from Worklogs in ServiceDesk Plus Cloud

6 May 2026

If your team logs worklogs in ManageEngine ServiceDesk Plus Cloud and you want that activity automatically reflected as a note on the request, you’ll be…

Read more