Set a variable with default value based on another variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2019 04:13 AM
Hi,
We need to set up one variable with different values based on another variable on the joiner form.
Variable "Team" type select box . if select box is IT. then another variable "shareddrive" of type " multi line text" will show default value as " this is the default drive IT team needs access"
and if
select box in Team variable is HR, then the same another variable " shareddrive" of type " multi line text" will show default value as " this is the default drive HR Team needs access"
Regards,
B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2019 05:20 AM
Hi,
Add advanced refence qualifier with 'Assess to Shared Department Folder ' variable
Add code like -New 'Script Include Name'().function_Name(Team value);
Team value is variable 'Team' value.
You have to write script include and return value based on Team value.
for more refer below link.
Mark this answer as Correct and Helpful
Thanks,
Manjusha Bangale
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2019 05:45 AM
Hi,
Go with below link .
https://community.servicenow.com/community?id=community_question&sys_id=43918769db98dbc01dcaf3231f96190d
dont use reference qualifier instead use on change client script on variable 'Team' to call script include.
Thanks,
Manjusha Bangale

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2019 05:07 AM
Hi
Can you try this :-
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if (g_form.getValue('u_team')=='it') {
g_form.setValue('ATSDept',"this is the default drive IT team needs access");
}
}