Anyone know a way to update a CDT column dynamically using a custom rule or func

Certified Associate Developer
Anyone know a way to update a CDT column dynamically using a custom rule or function? I realize I can create a script task to loop through the CDT and set the column value. I just wanted a more dynamic way to doing it.

CDTa - can be multiple values.
CDT columns - column1, column2, column3

I want to loop through the CDT and set column2 to a specific numeric value

I reviewed the apply function and the custom plugins - IFM Manager, Set CDT Properties and CDT Manipulation - just wondering the most efficient option.

OriginalPostID-150052

OriginalPostID-150052

  Discussion posts and replies are publicly visible

Parents
  • Hi dsmithgxp,

    Have a look at below, might help you:
    1) Let's say you want to update pv1_CDT.column2.
    2) Initially fill pv1_CDT by querying DB.
    3) Prepare an array type, with the values you want to update at column2.
    4) In script task output's use operator "is stored at index" to store above array at indices calculated by below expression:
    enumerate(length(pv!pv1_CDT))+1
    Look for error: The count of indices and the count of "values to update array" should be equal length.
Reply
  • Hi dsmithgxp,

    Have a look at below, might help you:
    1) Let's say you want to update pv1_CDT.column2.
    2) Initially fill pv1_CDT by querying DB.
    3) Prepare an array type, with the values you want to update at column2.
    4) In script task output's use operator "is stored at index" to store above array at indices calculated by below expression:
    enumerate(length(pv!pv1_CDT))+1
    Look for error: The count of indices and the count of "values to update array" should be equal length.
Children
No Data