I have a process variable of MULTIPLE text data type. I would simply like to st

I have a process variable of MULTIPLE text data type. I would simply like to store this variable into a cdt with multiple values. For example, if I have a multiple text data type "dept" process variable with {"Accounting", "Finance", "Operations"} values, I would like to store the values of "dept" process variable to a "deptDetail" cdt ("deptDetail.dept"). I tried using script task by going to output section and saving the "dept" to "detpDetail.dept" cdt, but its only writing the first value. Can someone help in this regard?
Thanks!

OriginalPostID-160677

OriginalPostID-160677

  Discussion posts and replies are publicly visible

Parents
  • It sounds like deptDetail is an array of this particular CDT, if that is true, you can try:
    apply(
    type!deptDetail (
    dept: _
    ),
    merge({"Accounting","Finance","Operations"})

    Which essentially creates an array of three deptDetail CDT's each with a different "dept" value from the merge() function. However, if this is a pre-existing CDT array and it contains other values you wish to preserve, you may wish to explore writing a rule that accepts the CDT and the update value and use the looping functions to iterate across your existing array of CDTs.

Reply
  • It sounds like deptDetail is an array of this particular CDT, if that is true, you can try:
    apply(
    type!deptDetail (
    dept: _
    ),
    merge({"Accounting","Finance","Operations"})

    Which essentially creates an array of three deptDetail CDT's each with a different "dept" value from the merge() function. However, if this is a pre-existing CDT array and it contains other values you wish to preserve, you may wish to explore writing a rule that accepts the CDT and the update value and use the looping functions to iterate across your existing array of CDTs.

Children
No Data