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.

Can we use is one of UI POLICY condition with string

MalikB
Tera Contributor

Hello,

 

I want to ask if we can use is one of ui policy condition to get string value in a hidden ctalog variable created?

6 REPLIES 6

Mohammad Danis1
Giga Guru

Hi @MalikB , 
Yes, you can use “is one of”  in a UI Policy condition but what is your business requirement here?

MackI
Kilo Sage

Hi @MalikB 

 

From the example of your screenshots---

 

 

  • vs_var_dotation_hidden and vs_var_dotation_futur_hidden are likely hidden variables.

  • They are being evaluated using the "is one of" condition, and the values being compared against ("typeDotation"...") appear to be string values or sys_ids of records that are treated as strings in this context.

 

 

it will works but there are some things you need to know ---

 

For straightforward show/hide, mandatory, or read-only requirements based on simple conditions (is one of, starts with, equal to, etc.), UI Policies are superior.

 

Drawbacks of UI Policy

  • UI Policies do not have access to the newValue or oldValue of a field, which Client Scripts do
  • If your hidden variable's value needs to be dynamically populated based on user input elsewhere on the form then better to use client script
  • If you want better User Experience , use client script as well.

 

If you like this opinion and your problem is resolved after reviewing and applying it. Please kindly mark this your best answer‌🌠‌ OR  mark it  Helpful ‌‌ if you think that you get some insight from this content relevant to your problem and help me to contribute more to this community

MackI | ServiceNow Technical Consultant | DXC Technology Australia | ServiceNow Practice | LinkedIn Top IT Operation Voice 2023 | Sydney,Australia