It is possible to control the visibility of the fields in a form based on the value that a user selects by inserting Form Rules into the appropriate attribute of an object. In our practice, if the Employment Type is set to Self-Employed or Retired then the field Employer will be hidden.
Navigate to Setup → Data Management → Data Models.
Open the Auto Loan Data Model.
Select the Forms tab and open the Auto Loan form.
Click the Edit Form Rules. It will open a pop-up window to manage the form rules.
Click the Add Rule button. Select Standard Rule
From the If dropdown list, select the Any option.
In the Conditions section select Employment Type(1) – Contains(2) – Self-Employed(3) and then click the green plus button (4) to add this condition.
Select Employment Type(1) – Contains(2) – Retired(3) and then click the green plus button to add the new condition for the Retired option..
In the Actions section, select Hide (1), then select all the elements related to Employer (2). Click the green plus button to add this action.
Finally, edit the Name of the rule and insert ‘Hide Employer Name’.