set visible in variable set
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2025 12:06 AM - edited 05-14-2025 12:08 AM
Hi Everyone,
I have a requirement where on the catalog item,
there are two custom fields in multi row variable set called select choice and application tag -
when a Type B is selected in choice field on the catalog form from choice field
field in the variable set select choice should be visible with the choice azure and on prem.
and only when on prem is selected another field called application tag should be visible (in variable set).
I am new to variable sets can anyone help me out here please.
how shall I achieve this?
thanks!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2025 12:10 AM
so you have 2 variables within MRVS and 1 variable outside the MRVS?
1) If yes then you can access the outside variable value in MRVS onLoad catalog client script and remove the options you don't want
check my blog on how to access the outside variable in MRVS client script
Access value of catalog item variable within MRVS client script
sharing here as well
var applicationType = g_service_catalog.parent.getValue("outsideVariableName");
2) Also you will require 1 catalog UI policy which Applies on Variable set (MRVS) on "Select choice" so that when value is on prem you show the other MRVS variable using Catalog UI policy action
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2025 01:01 AM - edited 05-14-2025 01:06 AM
Hi @Ankur Bawiskar ,
thanks for the reply, so I have one on load catalog script in MRVS mentioned below:
where I making field called select choice visible when TYPE B is selected in field called ' this is regarding':
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2025 01:37 AM
you are using wrong scripts
why did you use this function toggleSelectChoiceVisibility?
this function is not valid setDisplayTableField
I believe I have already shared a working solution and approach, link for the article already shared above.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2025 01:54 AM
this is updated script
but it's not working.