[Tips & Tricks] Show/Hide sections in a request form using FaFR

[Tips & Tricks] Show/Hide sections in a request form using FaFR


Scenario :

To show/hide sections in a request form based on user departments.

In this scenario users from 2 departments, "Business Analyst" and "Technical Analyst" will be using a service template "New Laptop" to submit service tickets for their need for a new Laptop. The service template is configured with multiple sections based on department fields. Using the following script, 2 different fields and form rules have been configured. When the user from each department loads the request form, the rule gets applied, the request form shows/hides sections based on the user's department.

$CS.hideSection("<section name>");
$CS.showSection("<section name>");

This feature is available from 11118 builds for ServiceDesk Plus

Solution :

Created a  service template "New Laptop" with  2 sections and configured fields based on departments "Business Analyst" and "Technical Analyst"




Configured Field and Form Rules with "On Form Load" for individual departments.




Form rule configured for the "Business Analyst" department.

$CS.showSection("Business Analyst");
$CS.hideSection("Technicial Analyst"); 



Form rule configured for the "Technical Analyst" department.

$CS.showSection("Technicial Analyst");
$CS.hideSection("Business Analyst"); 




Bruno from the "Business Analyst" department had loaded the service template "New Laptop". Form rule got applied, hides the "Technical Analyst" section, and displays the "Business Analyst" section. 


Anto from the "Technical Analyst" department had loaded the service template "New Laptop". Form rule got applied, hides the "Business Analyst" section, and displays the "Technical Analyst" section. 


I hope this scenario and script gives you an idea on configuring section hide/show with the help of FaFR scripts. You may know more about java scripts functions.




                  New to ADSelfService Plus?