Some PDIs are currently unavailable, and PDI actions are paused. View the latest updates here. Read More

Catalog UI Policy and Catalog UI Policy Action

DeIvory Gordon
Tera Guru

Hello,

 

I am creating a catalog item and I need to create a catalog UI Policy and Catalog UI Action based on the variable below:

 

* Is Terminated User a Manager?

    Dropdown List with Two options:

      - Yes
      - No

 

UI Action if Yes is selected:

 

Direct Reports

This should auto populate a list of the manager's direct reports.

 

I do not know how to set up the UI Policy Action so that a list of the manager's direct reports auto populates.  Thank you for any help you can offer.

 

2 ACCEPTED SOLUTIONS

Dr Atul G- LNG
Tera Patron

Hi @DeIvory Gordon 

 

In this case, you need to set the value using a script. A UI Policy can only perform three actions: make a field Read-only, Mandatory, or Visible. If you want to set or modify a field value, you need to write a script in the Advanced section of the UI Policy.

*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG

****************************************************************************************************************

View solution in original post

Nishant8
Tera Sage

Hello @DeIvory Gordon , If I understand the requirement correctly then you'd like to show direct report based on user selected in another variable. If so, I think there is no need of UI policy here,. Instead, you can have/create two reference variables that refer to User [sys_user] table and one On Change client script.

- First reference variable should be of type simple and referring to User table

- Second reference variable should be of type Advanced with following configuration:

  • Reference qualifier: javascript&colon; 'manager=' + current.variables.<first_variable>;
  • Variable attributes: ref_qual_elements=<first_variable>

- Create additional On Change Client Script to clear the value:

   

function onChange(control, oldValue, newValue, isLoading) {
    // Do not run when the form is loading
    if (isLoading) {
        return;
    }
    g_form.clearValue('<second_variable>'); 
}

OR

Alternatively, you can hide the second variable initially and make visible based on the UI policy that you referred to. Also, you can have the Checkbox variable included in the reference qualifier of second variable.

 

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron

@DeIvory Gordon 

where should the manager's direct reportees be auto-populated?

share form screenshots

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader