Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

How to auto populate variables by the use of system property?

Vishal_Jaiswal
Mega Guru

I have a requirement where we need to dynamically show/hide and auto-populate fields in a Record Producer based on selected values.

Scenario:
We have the following variables in a Record Producer:

  1. Category(Select Box)

  2. Subcategory(Select Box)

  3. Subject

  4. Attachment

Requirement:

  • Based on the selected Category and Subcategory, the Subject and Attachment fields should auto-populate and become mandatory.

  • If no matching combination is found, these fields should remain hidden.

  • There are 50+ such combinations, where multiple fields need to auto-populate and toggle mandatory status.

Constraints:

  • We cannot use UI Policies, as that would require creating 50+ separate UI Policies which would be difficult to maintain.

  • Looking for a solution using System Properties, Client Script, or other optimized logic to handle this efficiently.

Has anyone worked on a similar requirement? Please suggest the best approach or share any sample implementation.

Thanks in advance for your guidance!

@Ankur Bawiskar 

5 REPLIES 5

Hi Ankur,

Thanks for your response.

I am stuck at, how to define combinations in the system property and how to call that in client script as per my requirement.