Business rule for Variable set

New Developer_S
Giga Sage

Hi,

Can some one write me the code of  a business rule which needs to fetch the Variable set on catalog item ?

Basically , I need to auto populate  OR add variable set to Catalog Item when the category is software and another field is set to true.

I am not very sure how to read the variables in variable set. I need both variables ( 2 check boxes ) need to be fetched via Business rule .

Can some one help ?

 

 

regards,

TIA

 

7 REPLIES 7

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @New Developer_S 

Did you try with UI policy to make field / variable mandatory? Share where you stuck and exact use case?

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Harish KM
Kilo Patron
Kilo Patron

Hi @New Developer_S Variable sets are already tied to a catalog item. Why would you want to add them through script?

I assume your question is on the autopopulate and make the variable read only? Then share what type of variables are those? This can be achieved with help of onchange client script

 

 

Regards
Harish

Anubhav24
Mega Sage
Mega Sage

Based on the your query you need to do two operations , show/hide variables form variable set or the complete variable set and auto populate values on variables,

For visibility you can try UI Policy(recommended)/Client Script,

For auto population you need to make a call to backend table through client callable script include using "GlideAjax" API functionality.

Let us know the exact requirement with screenshots so that the solution provided can target the exact requirement.

Please mark correct/helpful if my response helped you.

Hi,

I want to retrieve a complete variable set ( which has 1 label and 1 check boxes ) 

The complete requirement is like this :

NewDeveloper_S_0-1707134440787.pngNewDeveloper_S_1-1707134546273.png

I need to populate the above variable set in every catalog item -

conditions are

When the Category is software and the check box for Confirmation of data protection and information security training required is checked.

 

Can you provide please Code for this requirement ?

 

Thank you ,