Hi all,
Before writing a CDT array to the database in my process model, I want to update all elements of the array with a different value. How can I do this?
For example, let's say I have a process variable named pv!myCDT (which is a CDT array) with this value:
{ { name: "Ben", age: 60, retired: false }, { name: "Sam", age: 65 retired: false } }
and I want to update all 'retired' fields to true. How can I do this in a process model? Should I use a script task for this?
I tried using a script task and added a custom output but this only changed the first element. It looked like this:Expression = 'true', Operator = 'is stored as' Target = pv!myCDT.name
Thanks for the help!
Discussion posts and replies are publicly visible
Hi,
You can use foreach function for achieving you issue.
load(
local!data: { { name: "Ben", age: 60, }, { name: "Sam", age: 65 }}
a!foreach(
items: local!data,
expression:a!typeyourecdt(
name:fv!item.name,
age:fv!item.age,
retired: false
)))
it will help you,
Regards,
Bhanu