- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2015 06:33 AM
In Record producers we have checkbox question as below
Capacity Sheet is Label and below values as checkboxes.
We want to map these checkboxes values in script section of Record Producers so it reflects in Notes field of Incident.
How can we do that. Please suggest
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2015 02:37 AM
You can loop through all the check boxes with a condition inside the loop to check if the check box is true.
var checkBoxVariables = [];
checkBoxVariables[0] = 'check_box_variable_1';
checkBoxVariables[1] = 'check_box_variable_2';
checkBoxVariables[2] = 'check_box_variable_3';
checkBoxVariables[3] = 'check_box_variable_4';
var checkBoxLabels = [];
checkBoxLabels[0] = 'check_box_label_1';
checkBoxLabels[1] = 'check_box_label_2';
checkBoxLabels[2] = 'check_box_label_3';
checkBoxLabels[3] = 'check_box_label_4';
for(var i=0; i<checkBoxVariables.length; i++) {
if(producer[checkBoxVariables[i]] == 'true') {
current.description += '\n' + checkBoxLabels[i];
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2018 06:23 AM
Hi,
Can`t get this work and I think it is related to how to assign the variable to checkBoxVariables correctly.
I thought it would be just like this:
checkBoxVariables[0] = producer.<variable_name>;
But it does not work.
Can you help a bit and Servicenow instance is Istanbul if any relation to that.
At least if I just do like this:
current.description = producer.<variable_name>; // Select Box -> returns -> True
Br,
Jussi