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.

Dot Walking in a Catalog Item UI Policy not working

kevinray
Giga Expert

I have a reference field in my catalog item that looks up servers in our cmdb_ci_hardware table.

I have two other questions that I want to ask based on the class of the server they select

I created a UI Policy and dotwalk to the class field

find_real_file.png

The issue is that as soon as a populate the build type with "Copy of an Existing Server" the Storage size windows field shows up on the form.

It doesn't even wait for me to select the server to know what the cpr_server_name.Class even is.

1 ACCEPTED SOLUTION

sethivarun
Kilo Guru

Hi Kevin,


Apparently UI policy doesn't work with dot walking



ConditionsThe conditions which, if fulfilled, cause the UI policy to be applied. Conditions are built with the condition builder. To set conditions using a script, use a client script instead.

Conditions are only rechecked if a user manually changes a field on a form. If the change is made by a UI action, context menu action, or through the list editor, it is not evaluated.


In UI11, the field must be on the form to be checked by a UI policy. To test the value of a field but hide it from users, add the field to the form and use UI policies to hide it. This requirement also prevents dot-walked fields from being used as conditions.



HEre is the link Create a UI policy



Please mark the answer has helpful or correct based on the impact on the question


View solution in original post

12 REPLIES 12

Yes. Absolutely. That is the table that my catalog item variable is referencing. cpr_server_name is referancing the CMDB_CI_HARDWARE table.



But i'm trying to make a different field visible based on the class of that variable in a Client Script.


If i don't dot walk to cpr_server_name.class, but instead just pick "class" from the choices, that is not the same 'class' as the variable hardware class.



screenshots below



If I just pick class, and dont dot-walk, I get a list of classes that have nothing to do with CI classes.


find_real_file.png


If i DOT WALK, I get the following (which are my server classes)


find_real_file.png


Hey Kevin,


That was me being dumb.



Yes you are correct, we faced the same thing a year or so back.   what we did was that we created another drop down with window, linux and server type optio n and based on the filter we provided a list of servers and the corresponding fields.


Thanks for your feedback/input varun. Cheers