Parsing contract variables coming from a form


Hi everybody,
I'm working in a process with a mailing connector. I have a form with a table widget to select some lines. When I select these lines I send them to a contract variable (multiple text). What I'm trying is parsing the content of this variable to fit data in the body of my email. At this moment I have only a beautiful string like this:
" [{persistenceId=111, .., field1=john, field2=snow,..}, {persistenceId=200, ..., field1=mary, field2=skye,..}] ".

I'm new in this kind of code. Perhaps someone could give me a way to try this.

Thanks in advance and regards,

Walter R.


Submitted by on Tue, 12/12/2017 - 14:53

How could you make a table where you can select more than one row?

Submitted by whramirez on Tue, 12/12/2017 - 21:26

I've used a template imported from AngularJS (ui-grid, I think) and then adapted to fit as a custom widget.

1 answer


doing more investigation on Internet I've found a solution using split groovy function:

I'm testing and perhaps it will be my method. But in form I must use a column separately to work every list I send to my contract variables, for example my field1 will see '[ a, b, c]', my field2 will see '[ 1, 2, 3]' and in groovy script I'll use :
String col1 = contract1; //(it has field1)
String col2 = contract2; //(it has field2)

def mylist1 = col1.split(',');
def mylist2 = col2.split(',');

À suivre...