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 UI Policy issue

Michael Domke
Tera Guru

I have two fields on a form. Both are reference fields and both are mandatory. One is for a monitor and the other is for a computer. I want to set it up so if you choose a monitor in which its "Status" field is set to "Shared", I want to remove the mandatory requirement for the computer field.

For example, if Monitor.Status = Shared, remove the mandatory requirement on the computer field.

Setting up a UI Policy seems the right way to handle this. But, I'm having an issue in that the value of Monitor.Status is returning as [blank] when evaluated by the UI Policy (I have "Debug UI Policies" turned on). But on the underlying monitor record, the value of Status is not blank, it's set to "Shared".

Should dot walking work when setup this way?

Michael

4 REPLIES 4

garyopela
ServiceNow Employee
ServiceNow Employee

http://wiki.servicenow.com/index.php?title=Creating_a_UI_Policy

Look at the table under 2 Create a UI Policy for the Conditions. It explains why you cannot dot-walk in a UI Policy.

Your choices are either to add the reference field to the form so you are not dot-walking, or to put a GlideRecord lookup to return the information, which would preclude it from being in the conditions.


I saw that article but I guess I read that differently. That is, I read it as dot walking is OK as long as the field is visible on the form. Both my fields are visible on the form.

The field must be on the form to be checked by a UI policy ... This requirement also prevents dot-walked fields from being used as conditions.

But I guess what this is really trying to say is, the referenced field (the "dot-walked" field), in my case Monitor.Status, must be a separate field and visible on the form.

Thanks for the reply,
Michael


Oh, that's strange. Are you dot-walking through the conditions builder or via a script?

I have done what you are wanting, for instance, I have a checkbox on the CIs that I needed to show/hide/make required fields on Change based on the values in that checkbox for the CI on the change.

In my ui policy, I have the condition of Configuration Item (CI).Indicator is Yes. If I look at it in the list view, then the condition is cmdb_ci.u_indicator=Yes


Yes, I'm using the Conditions Builder in the UI Policy.

My conditions are:
MonitorISNOTEMPTY^Monitor.install_status=11

When this is evaluated, Monitor.install_status shows as blank when in reality, the underlying monitor record does have a Status (install_status) of 11 (Shared).

So this should work?