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 04:38 AM
Writing an onChange client script would help in this case
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2019 04:52 AM
Hi,
Tried that but not working, default value is not updating, please can you help in writing that.
code i used:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if (g_form.getValue('Team')=='it') {
g_form.setDefaulyValue('ATSDept',"this is the default drive IT team needs access");
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2019 05:03 AM
Hello,
Do verify if the field name or Question Name is 'Team'. and also the value of the choice is 'it'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2019 05:06 AM
Also, use setValue instead of setDefaulyValue
g_form.setValue('ATSDept',"this is the default drive IT team needs access");