For example, I have process variables arrays
name : {"a","b","c","d"},
age : {1,2,3,4},
email : {"@e","@r","@t","@w"}and I have a CDT which has {name,age,email} How can I save those array values in my CDT in process model? bcz when I try to use script task to save the array values in CDT and write in the db using cdt then only first row is getting written in db.
Discussion posts and replies are publicly visible
when you have arrays of value(CDT) and you want to write all to rows in database then you have to config this in "write to data store entity node" below name and type there is a checkbox multiple(for your data input) , try to select it and then try writing to the data store entity
Multiple checkbox is greyed outfor more clarity, Im pasting the script task where im passing the array values to cdt,
you are writing the data (param3) right? were you able to store multiple data in it ? from your process instance photo it shows only one set of data(first values).
if thats the case then - check if you variable param3 can have multiple values
and try storing the data into the variable like this
a!localVariables( local!name:{1,2,3,4}, local!age:{"10","20","30","40"}, local!param3: a!forEach( items:local!name, expression:'type!{urn:com:appian:types:CP}CP_uiDataBase'( test_int: local!name[fv!index], test_text: local!age[fv!index], test_date: null ) ), local!param3 )
Thanks it has worked