
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2020 08:58 AM
Hi All,
We have a Assignment group variable in one of ours variable sets. We want to set that assignment group variable value by default for some items (Group value will differ from different items).
How to set that Assignment group variable (present in variable set) value to achieve above condition!!!
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2020 09:31 AM
Hi Ganesh,
sample script below
function onLoad(){
g_form.setValue('group_variable', groupSysId);
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2020 09:05 AM
Hi Ganesh,
you can have client script which applies to variable set
in the onload client script you can check the catalog items; if it is ABC or XYZ then you can set the default value
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2020 09:15 AM
Hello Ankur,
Could you please provide me sample if condition code!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2020 09:31 AM
Hi Ganesh,
sample script below
function onLoad(){
g_form.setValue('group_variable', groupSysId);
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2020 09:06 AM
Hi,
You need a onload client script in each catalog item to do this and then use simple code:
g_form.setValue('assignment_group','sys_id');
Thanks,
Ashutosh