Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

UI Policy for MRSV

Zaman Sm
Tera Expert

Hello,

Currently I have a MRSV field name "Travel location and duration" to collect information from the user. The MRSV has 4 field and one of them is single line text "Travel Location". I would like to make this field a multi select variable with dropdown of all the Canadian provinces names, when the user select "CANADA" as their travel destination in the "Country" field.

ZamanSm_3-1722460800587.png 

ZamanSm_6-1722460827826.png

 

 

 

 

My initial thought is to create another field (Multi select) as ""Travel Location"" and Active==false. and whenever user select Canada, this field will be set as active==true and the existing field "Travel Location" (free text) will be set as active== false

 

May I have some direction and instructions on client script implementations for this idea?

 

Thanks in advance

Masud 

1 ACCEPTED SOLUTION

Are you aiming to hide the Canada Locations from the MRV grid view (your first screenshot)?

Are you implementing the UI Policy on the MRV? I am replicating something similar and it appears that it works. However, I cannot hide the "Canada locations", the Canada locations will show on the table (your first screenshot). â€ƒ

 

In my example: category is where I will pick something from a list, then if I pick "Airfare", then I have to select from "Where" one of the entries. 

 

Screen Shot 2024-07-31 at 4.47.11 PM.png 
Selecting Airfare, makes Where Mandatory

Screen Shot 2024-07-31 at 4.48.24 PM.png 

The grid view of the MRM

 

Screen Shot 2024-07-31 at 4.49.27 PM.png

 



Want to connect? Follow me on LinkedIn

View solution in original post

4 REPLIES 4

Isela Phelps
Tera Guru
Tera Guru

I haven't worked on MRVs in awhile so I may be a bit rusty on this guidance: you could try a UI Policy with the Catalog Condition of if Country==Canada, then add the Policy Actions of Canada Locations list as Mandatory=True and Visible=true, you will also want to hide the other Travel Location (free text) Visible=False. 



Want to connect? Follow me on LinkedIn

Thanks for your response,

I tried that, but the UI policy wont let me choose the MRSV as a condition.

Are you aiming to hide the Canada Locations from the MRV grid view (your first screenshot)?

Are you implementing the UI Policy on the MRV? I am replicating something similar and it appears that it works. However, I cannot hide the "Canada locations", the Canada locations will show on the table (your first screenshot). â€ƒ

 

In my example: category is where I will pick something from a list, then if I pick "Airfare", then I have to select from "Where" one of the entries. 

 

Screen Shot 2024-07-31 at 4.47.11 PM.png 
Selecting Airfare, makes Where Mandatory

Screen Shot 2024-07-31 at 4.48.24 PM.png 

The grid view of the MRM

 

Screen Shot 2024-07-31 at 4.49.27 PM.png

 



Want to connect? Follow me on LinkedIn

Hello Isela,

I am able to hide and show other fields using the UI policy. Created the UI policy only for variable set with the following logic,

  • If country==canada, Travel Location Visibility==False ZamanSm_0-1722531312274.png

     

  • If country != canada, Province's Visibility==False ZamanSm_1-1722531332712.png

     I am accepting your solution, as it led me towards the solution.

Thanks