Business rule for Variable set
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 02:18 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 02:27 AM
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]
****************************************************************************************************************

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 02:46 AM
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
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 02:58 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 04:06 AM
Hi,
I want to retrieve a complete variable set ( which has 1 label and 1 check boxes )
The complete requirement is like this :
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 ,