Skip to main content
Kinetic Community

Changing a Check Box Answer from a List to a Column

How to change a CSV list to a vertical stack or column.

Usage

Check box answers are often used to pass a list of desired items like hardware add-ons, requested software, or report access.

If you want to pass these to a Remedy field in a parameter in a handler, you need to convert the answer first in an Echo handler, and then reference the result of that handler.

The function that you will use is gsub, which takes one input and replaces specific characters with other characters. In this case, we are replacing spaces with cariage returns.

But wait - I thought we were dealing with a comma seperated list? Well, the Echo handler will replace the commas with spaces, so you have a "space' seperated list. And before you ask, it will work if your individual answers have spaces in them.

So here is the code that you will put into your echo node that converts the list to a column:

<%=@answers['question'].gsub(/,\s*/,"\n")%>

The first part of the code gets the current answer - <%=@answers['question']

The gsub function replaces commas and spaces (/,\s*/) with carriage returns ("\n").

Here is an example of the code that will go in the parameter that is passed to a field in a Remedy form:

<%=@results['Echo Handler']['output']%>

Replace "Echo Handler" with the name of your own echo handler.

Example

Here is a screen shots of a Task Tree using the code above:

Task_BUilder_Echo_List.jpg

Here are the details of the Echo Convert List Node:

Echo_Convert_List_Node.png

Here is the parameter field that passes the value to the Summary field on the Kinetic Sample Incident Remedy form:

Echo_Parameter_Field.png