Parameter value separated by | sign

I have created a parameterized task where I am passing multiple selection for one parameter, everything is fine but when I am doing multiple selection under parameterized description action script its printing them comma (,) separated.

thats the problem, I want values should be separated with pipe sign (|), so that my command execution happen properly. any idea please.

below is the xml code -

<TD style="PADDING-RIGHT: 5px" width=300 align=right><?hxlat Test action parameters:?></TD>
<TD align=left><SPAN><INPUT type=checkbox value=Test1 name=Test_Action> <LABEL for=Test_Action>Test1</LABEL> </SPAN><SPAN><INPUT type=checkbox value=Test2 name=Test_Action> <LABEL for=Test_Action>Test2</LABEL> </SPAN><SPAN><INPUT type=checkbox value=Test3 name=Test_Action> <LABEL for=Test_Action>Test3</LABEL> </SPAN><SPAN><INPUT type=checkbox value=Test4 name=Test_Action> <LABEL for=Test_Action>Test4</LABEL> </SPAN></TD></TR>

below are the parameter value which action is picking under details, when I selected Test1 & Test4 from the selection.

Parameters   
Test_Action Test1,Test4

I believe that is default based on how JavaScript would convert an Array to a String.
I don’t have the exact code, but I think you will need to create the parameter yourself at the JavaScript level, probably in the onTakeAction() function. Something like

var MyNewParameter=document.getElementById("Test_Action").join("|")

1 Like

Or handle it inside the ActionScript

parameter "MyNewParam"="{concatenation "|" of substrings separated by ", " of parameter "MyOldParam"}"

2 Likes

You are awesome Jason :slight_smile:

.join gave the idea, I have updated mine with below.

 var selected = [];
    for (var i=0; i < checkboxes.length; i++) {
    	if (checkboxes[i].checked) {
        selected.push(checkboxes[i].value);
    	}
    };
    return selected.join('|');
};
2 Likes