Mandatory Multi-Row Variable Set - ServiceNow Community
Mark Roethof
Tera Patron
Tera Patron

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 making the Multi-Row Variable Set mandatory. Mandatory like having to add at least one record. Because recently I answered multiple community questions on this topic also, I thought let's give it a try to write an article with some additional information.

Default behavior

When setting up a Multi-Row Variable Set, and adding this to a Catalog Item or Record Producer, the default behavior looks something like:

 

find_real_file.png

Mandatory

On the Multi-Row Variable Set record itself, notice there's no mandatory flag for example. Sometimes there is, though it's just not on the form layout… in this case, absolutely no kind of mandatory flag.

 

find_real_file.png

 

Though available options which are helpful are:
1) Catalog Client Scripts
2) Catalog UI Policies

 

I've seen several example of Catalog Client Script usage on the Community. Though, because we want to explore No-code solutions first, let's have a look at Catalog UI Policies.

Catalog UI Policy

When adding a Catalog UI Policy and the Catalog UI Policy Actions on the Catalog Item level (not on the Multi-Row Variable Set level!), notice the available Variables on the Catalog UI Policy Action:

 

find_real_file.png

 

The Variable name field will list all Variables and all Multi-Row Variable Sets! Knowing this, is the actual gem of this whole story 🙂 Simply select the Multi-Row Variable Set, and change the Mandatory field to "True".

Note: On the Catalog UI Policy you don't need to add any conditions. In that case, the Catalog UI Policy Action will immediately be applied onLoad.

Result

find_real_file.png

 

Obviously, when one or more records added, the mandatory check is fulfilled. Just identical to the behavior of normal Variables.

---

And that's it actually. 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

ServiceNow Technical Consultant @ Paphos Group
---

LinkedIn

Comments
Clinton F
Tera Expert

Hey Mark,

Great post thank you.

I have tried your solution, currently on Paris Patch 4 and it is not working for me. Do you think this is something I need to raise with ServiceNow support as it sounds specific to the version I am using?

Regards

Clinton

Mark Roethof
Tera Patron
Tera Patron

Hi there,

Thanks. If you like the article, don't forget to mark it as helpful.

Your question: It should be able to work for the release and patch you are mentioning. You could just post a new question on the community, describing your situation, what you've exactly setup, sharing an image maybe, etc.. 

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020, 2021 ServiceNow Community MVP
2020, 2021 ServiceNow Developer MVP

---

LinkedIn
Community article, blog, video list

Clinton F
Tera Expert

Weirdly it doesn't display as mandatory within ServiceNow Client but does on the portal. So it has been working all this time but only from the portal. 

Client

find_real_file.png

 

Portal

find_real_file.png

Mark Roethof
Tera Patron
Tera Patron

Hmmm interesting finding. Have to test that.

Version history
Last update:
‎08-13-2024 10:59 AM
Updated by:
Contributors