Skip to main content
New Participant
Feb 10, 2023 11:42 AM UTC
Question

Is it possible to update a list of CDT with a specific value by index?

Hi all,

I want to replace each "trackerID" from local!test - local!test4 variables with a correct trackerId from local!Ids. Current values in dummyCDT are indexes of their corresponding IDs in local!Ids array.

local!Ids values are {24912; 24913; 24914} 

a!localVariables(
  local!test: 'type!{urn:com:appian:types:DBS}DBS_Tracker'(trackerID: 1),
  local!test2: 'type!{urn:com:appian:types:DBS}DBS_Tracker'(trackerID: 2),
  local!test3: 'type!{urn:com:appian:types:DBS}DBS_Tracker'(trackerID: 2),
  local!test4: 'type!{urn:com:appian:types:DBS}DBS_Tracker'(trackerID: 3),
  local!dummyCDT: union(union(local!test, local!test2), union(local!test3 ,local!test4)),
  local!Ids: index(ri!tracker, "trackerID", null),

  a!update(
    data: local!dummyCDT,
    index: "trackerID",
    value: index(
      local!Ids,
      local!dummyCDT.trackerID,
      null
    )
  ),

)

Is it possible to achievable this way?

3 replies

New Participant
Feb 10, 2023 11:44 AM UTC

It currently assigns the same value for every nested CDT in dummyCDT list

New Participant
Feb 10, 2023 12:01 PM UTC

problem solved

peter.lewis
Employee
Feb 10, 2023 4:56 PM UTC

If you figured it out, could you post what you did to resolve it? You could help someone else that runs into a similar issue in the future [emoticon:c4563cd7d5574777a71c318021cbbcc8]