logo

NJP

Read-only Multi-Row Variable Set

Import · Oct 27, 2019 · article

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

Hi there,

While working with the Multi-Row Variable Set on Catalog Items, a while ago I stumbled on the Multi-Row Variable Set being editable when working on Requested Items on the Platform UI. Because in our organization we tend to make all variables within the Variables editor Read-only, I did some diggin' on how to make the Multi-Row Variable Set Read-only.

I have answered some community questions on this topic recently, so not completely new. Though I'll try to give some additional information in this short article.

Related Community articles

While searching if someone already posted a question or written an article, I did come across some articles. For example, Tips and Tricks : MRVS (Multi Row variable set) : Part 2. Reading this, it does work fine, it does what it describes. Though, adding a UI Script, editing a Service Portal widget, etc.. Can't this been done easier?

Catalog UI Policy

My thought was, could this already be done through Catalog Client Script (with something like g_form.setReadOnly('internal_name_of_mrvs', true); or thru Catalog UI Policy and a Catalog UI Policy Action? Good news:

Catalog UI Policy, quick, maintainable, no code!

It's just a matter of adding a Catalog UI Policy, having "Applies on a Catalog Item view" unchecked, having "Applies on Requested Items" checked. The Catalog UI Policy then just needs a Catalog UI Policy Action. Within the Catalog UI Policy Action you could just select the Multi-Row Variable Set at the "Variable name" (it will just be listed there), and set "Read-only" to true.

image

Result

Before applying the Catalog UI Policy:

image

After applying the Catalog UI Policy:

image

Note: Tested on Madrid and New York.

---

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

Kind regards,

Mark Roethof

ServiceNow Technical Consultant @ Paphos Group---

LinkedIn

image

View original source

https://www.servicenow.com/community/developer-articles/read-only-multi-row-variable-set/ta-p/2308511