The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Make field mandatory depending on something else

DeIvory Gordon
Tera Guru

Hello, I would like to enforce mandatory fields on some fields when other fields are set to a certain value.  Can I do this without scripting?

3 ACCEPTED SOLUTIONS

Anand Kumar P
Giga Patron
Giga Patron

Hi @DeIvory Gordon ,

  1. Configure UI Policy:

    Go to System Definition > UI Policies and create a new UI policy.

  2. Define Conditions:

    In the UI Policy, define the conditions under which you want to make certain fields mandatory. For example, if you want to make the "Description" field mandatory when the "Category" field is set to "Hardware," set the condition as follows:

    • Table: Select the relevant table.
    • Condition: Configure it based on your requirement, e.g., [Category] [is] [Hardware].
  3. Define Action:

    In the same UI Policy, define the action to take when the condition is met. To make a field mandatory, set the "Mandatory" property to "True" for the field you want to enforce as mandatory.

    • Action: Select "Mandatory."
    • Field: Choose the field to make mandatory, e.g., "Description."
    • True: This sets the field as mandatory when the condition is met.

      Thanks,
    • Anand

View solution in original post

Sandeep Rajput
Tera Patron
Tera Patron

@DeIvory Gordon UI Policy is the feature using which you can address this requirement. Please refer to this detailed documentation https://developer.servicenow.com/dev.do#!/learn/courses/utah/app_store_learnv2_scripting_utah_script... which talks about UI Policy with great examples.

View solution in original post

5 REPLIES 5

Ashutosh C J
Tera Guru

Hi @DeIvory Gordon 
Yes you can do this with UI Policy and UI Policy action

jlaue
Kilo Sage

Anand Kumar P
Giga Patron
Giga Patron

Hi @DeIvory Gordon ,

  1. Configure UI Policy:

    Go to System Definition > UI Policies and create a new UI policy.

  2. Define Conditions:

    In the UI Policy, define the conditions under which you want to make certain fields mandatory. For example, if you want to make the "Description" field mandatory when the "Category" field is set to "Hardware," set the condition as follows:

    • Table: Select the relevant table.
    • Condition: Configure it based on your requirement, e.g., [Category] [is] [Hardware].
  3. Define Action:

    In the same UI Policy, define the action to take when the condition is met. To make a field mandatory, set the "Mandatory" property to "True" for the field you want to enforce as mandatory.

    • Action: Select "Mandatory."
    • Field: Choose the field to make mandatory, e.g., "Description."
    • True: This sets the field as mandatory when the condition is met.

      Thanks,
    • Anand

Hi @DeIvory Gordon , This can be achieved with the help of UI policy.

 

Please let me know if this works for you and mark helpful if its worked.

 

Thanks,

Dipen