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.

Retrieve system property value in UI policy

priyanka1028
Tera Contributor

Hi All,

 

I have created a system property which contain Sys IDs of catalog items and I want to use those values in UI policy condition and the condition will item.sys_id is one of System property sys_ids and UI policy will be on RITM table.

Anyone can help me with this requirement?

3 REPLIES 3

Tushar
Kilo Sage
Kilo Sage

Hi @priyanka1028 

Firstly create a System Property: This property will contain a list of Sys IDs (of catalog items).
Retrieve Sys IDs from the System Property: In the UI Policy condition script, you'll retrieve the Sys IDs from the system property and compare the item.sys_id of the RITM record with the values from the property.
Apply UI Policy Condition: You will use a UI Policy condition (will be written as a script) to check if the item.sys_id is in the list of Sys IDs stored in the system property.

 

Thanks,

Tushar

How to fetch sys Ids in UI policy?

Sheldon  Swift
ServiceNow Employee
ServiceNow Employee

Hi @priyanka1028 - This is achieved with GlideAjax. There is an OOB UI policy example you can follow here ("Show/Hide fields based on CLE_REPLATFORMING_WITH_KMF_PROP"): /nav_to.do?uri=sys_ui_policy.do?sys_id=d68b654a0b000010ef49eaf1a3673af7%26sysparm_view=advanced