List collector variable in workflow

karthiknagaramu
Kilo Sage

Hi,

I need to access the list collector variable in workflow approval script. Usually I create a workflow variable for each catalog variable and   access it as workflow.variables.variablename.

In case of list collector how would I access the values in it since it has multiple values.

Regards,

Karthik

1 ACCEPTED SOLUTION

Brandon Smith3
Kilo Expert

The list collector delivers its selections (what is moved to the right list collector box) into an array. To access the information you would need to parse through the array. I've included an example that I use in a workflow below, also including one where I set it to a string and comma separated values.



current.variables.list_collector_name //will give an array


current.variables.list_collector_name.toString(); //will give string with comma separated values


View solution in original post

1 REPLY 1

Brandon Smith3
Kilo Expert

The list collector delivers its selections (what is moved to the right list collector box) into an array. To access the information you would need to parse through the array. I've included an example that I use in a workflow below, also including one where I set it to a string and comma separated values.



current.variables.list_collector_name //will give an array


current.variables.list_collector_name.toString(); //will give string with comma separated values