
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
03-04-2020 10:23 PM - edited 08-03-2024 07:36 AM
Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
Hi there,
A situation that sounds familiar when working with fields with JSON code: The JSON code hard to read, the code looks unformatted, the structure or errors are hard to spot. So let's open a JSON viewer on the web, copy/paste the code, parse it…
While actually, there's a dictionary attribute in ServiceNow which might help you a lot. A hidden gem, already available in ServiceNow for ages: "JSON View". Basically: it will present an icon next to the field label, when you click the icon: the JSON is nicely formatted in a pop-up!
Out-of-the-box
For example, let's have a look at the "Option schema" field on the "Widget" form. This is a JSON field type. As you can see, unformatted.
Adding the attribute
Within the Dictionary Entry of the field, select the "Attributes" section and click the "New" UI Action.
On the "Dictionary Attribute" new record, simply add:
Result
After submitting the new Dictionary Attribute, return to the Widget form again. The result will be visible instantly. A small icon next to the field label will be visible.
And now, simply click the icon. A simple pop-up window appears with the JSON code nicely formatted!
---
And that's it actually. Hope you like this hidden gem. 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? |
Kind regards,
Mark Roethof
ServiceNow Technical Consultant @ Quint Technology
1x ServiceNow Developer MVP
1x ServiceNow Community MVP
---
- 11,338 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Great and very useful.
Thanks for Sharing 🙂
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
This is very usefull.
Does anyone know if it possible to improve it with color coding. Just like the "view XML" popup.
BR
Michael
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Can this functionality be enable for users with itil role, because once they click the JSON button, it shows like this, the user already has access to record.