AnsweredAssumed Answered

Generate a list from a string & pass it to a arraylist element in json profile

Question asked by 125033043 on Jul 31, 2017
Latest reply on Jun 21, 2018 by pasan


I have dynamic string that has person numbers separated by ',' (comma). example Persons = "100,101,102,103,104,...n".

Now I have a JSON "Employee" profile that accepts Person Numbers as ArrayList. I have a map in which the right hand side having that profile JSON "Employee" profile. I use script function with in that MAP and tried below script.


List<String> list;
if(persons != null){
list = persons.split(',');

And I have taken script output as "list" and map that output to the that profile Arraylist element.

But I am getting null. It seems that Map outputs only String or other simple datatypes but not list.


It is written in document,

You do not explicitly define the output data type. The data type is inferred by the scripting engine based on the value assigned to the output variable. 

Is there any alternative or a way to generate a list from a string and pass it to a profile?


Thanks and Regards

Deepak Aggarwal