How to display the selected checkbox values in task short description
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2020 09:59 AM
Hi Team,
I have a form that contains a checkbox values. For example:
On selection of the checkboxes, a task gets created using a run script in the workflow.
How to set the respective selected choice as "short description" in task form even if multiple choices are selected.
Kindly help!
Sujatha V.M.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2020 10:06 AM
in run script do something like
var notes = ' ';
if (current.variables.1 == 'true') {
notes += "Application 1,";
}
if (current.variables.2 == 'true') {
notes += "Application 2,";
}
if (current.variables.3 == 'true') {
notes += "Application 3,";
}
if (current.variables.4 == 'true') {
notes += "Application 4";
}
task.short_description = "User has selected" + notes;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2020 10:27 AM
Hi Sujatha,
please try this
Ensure you use valid variable names
var str = '';
if (current.variables.variable1.toString() == 'true') {
str = str + "Application Access 1,";
}
if (current.variables.variable2.toString() == 'true') {
str = str + "Application Access 2,";
}
if (current.variables.variable3.toString() == 'true') {
str = str + "Application Access 3,";
}
if (current.variables.variable4.toString() == 'true') {
str = str + "Application Access 4";
}
task.short_description = "User selection" + str;
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
06-08-2021 12:40 PM
Hi Ankur,
In this case what is variable1 and application access 1, pls confirm.
-Suresh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2021 09:46 PM
Hi,
variable1 means the different variables.
application access 1 is a generic text
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader