Hello community,
I am tried to store my all data of form into database,
So in that I used more than 1 CDT in my form, and then I am using script task to mapping one ID into other one, and then I am using multiple data store entity
to send all data at a time in different tables of database.
So now the issues is that My all data is saving but
script task is not working, I am unable to mapping ID.
So what I have to do to map.
Discussion posts and replies are publicly visible
You need to run write to DSE node. NOT write to Multiple DSE. because you need the ID of first table in the second one. Therefore, you a write to DSE, store the output in the same variable, use a script task to map the id into another table, and then write the second table.
First I used write to DSE from that I take only 1 CDT in that and I got the ID and that after used script task, and then I used
Multiple DSE than I am getting all the details in my database
Thanks for your suggestion.
But If I have to use more than 10 CDT to store and mapping ID, so I have to create 10 Write to DSE and script task for these or use Multiple DSE
Hi Harshit , I have inserted data to first table using Write to DSE smart service. Then used script task to reassign the inserted id from the previous step to foreign key of the second table. It asignes foreign key value to the first record and doesn't assign other record. . In the scrip i used multiple parametr value and it didn't help
If you need to insert multiple record into the second table, you might want to use a!update() in a foreach() to update the foreign key in all the records.
1 ) Where should I write that code in scripttask ? Is it output tab and expression window ?
2) below code looks okay ?
a!forech ( items : transactionrlist
expression : a!save( fv!item.Foreignkey , id)
)
3) if above code is wrttien in expression editor window ( script task, output tab) then what is the value of target ?
Your code in the output of a script task should like something like this
a!foreach( items: pv!something, expression: a!update( fv!item, "foreign key field", pv!customer.id ) )
a!save() does only work inside a saveInto on UI components.
Thank you ,Stefan .It is working now .