Mark Roethof
Tera Patron
Tera Patron

Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

 

Hi there,

 

Ever came across situations where Condition type fields are not human-readable, and are just displayed as the encoded query code? Wondering if we can do something about this? Yes we can! There's a Dictionary Attribute for that 😀.

 

Condition type fields on List Lay-out or Form Lay-out for a read-only record

When viewing Condition type fields on a List Lay-out, by default these would display as the encoded query. Like this example:

 

Screenshot (12).png

 

Condition type fields also are displayed as encoded query when viewing a Form Lay-out for a read-only record. Like this example:

 

Screenshot (11).png

 

"Readable" Dictionary Attribute

The examples given in the previous section are not very human-readable. While most of the encoded queries can be understood, you will get lost in translation when values are used. We can do something about this. There is an out-of-the-box Dictionary Attribute available to be used on the Dictionary Attribute Collection record for the specific Dictionary Entry. On an out-of-the-box fresh Washington DC Patch 3 Hotfix 1 instance, this Dictionary Attribute is applied 58 times.

 

The Dictionary Attribute I'm referring to, "Readable" with value "true" or "readable=true".

 

Screenshot (13).png

 

Source: https://docs.servicenow.com/bundle/washingtondc-platform-administration/page/administer/reference-pa...

 

Applying the Dictionary Attribute isn't that difficult and a case of seconds.

1) Go to the Dictionary Entries List Lay-out (sys_dictionary) and search for the field you are after using the "Column name" field and select "Type" "Collection"

2) Using the "Attributes" Related List, add Attribute "Readable" with value "true". Or add "readable=true" directly to the "Attributes" field on the Dictionary Entry.
The Related List and the Attributes field are out-of-the-box kept in sync through Business Rules, so you only have to apply one of the two methods.

 

Screenshot (14).png

 

After saving the changes, this should be effective immediately.

 

Result

Navigating to your Condition type field again, the result should now look something like:

 

Screenshot (16).png

 

Screenshot (15).png

---

 

That's it. Hope you like it. If any questions or remarks, let me know!

 

C

If this content helped you, I would appreciate it if you hit bookmark or mark it as helpful.

 

Interested in more Articles, Blogs, Videos, Podcasts, Share projects I shared/participated in?
- Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

 

Kind regards,


Mark Roethof

Independent ServiceNow Consultant
9x ServiceNow MVP

---

LinkedIn

Comments
jonsan09
Giga Sage
Giga Sage

Thanks for sharing, can't wait to make use of this.

luffy3478
Tera Guru

Will there be any performance hit? Just thinking why ServiceNow has not made this the default option? Are there any side effects that you have observed?

Mark Roethof
Tera Patron
Tera Patron

@luffy3478 No.

mohamed shibl
Tera Contributor

Hi Mark, 

Thank you for sharing this! 

I have tried it for a condition field that hast static dependent attribute to sc_req_item but it doesn't work. The conditions are like encoded queries at the list. 

 

Sydni
Tera Contributor

Hi Mark, 

Thank you for sharing! Can you set this at a Global level for all Conditions type fields?

Version history
Last update:
‎07-23-2024 10:41 AM
Updated by:
Contributors