How to display the selected checkbox values in task short description

Sujatha V M
Kilo Patron
Kilo Patron

Hi Team, 

I have a form that contains a checkbox values. For example:

find_real_file.png

 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!

 

 

 

Please mark this as helpful and accept it as a solution if this resolves your query.
Sujatha V.M.
8 REPLIES 8

Mike Patel
Tera Sage

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;

 

Ankur Bawiskar
Tera Patron
Tera Patron

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

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

In this case what is variable1 and application access 1, pls confirm.

 

-Suresh

Hi,

variable1 means the different variables.

application access 1 is a generic text

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader