Skip to main content
February 10, 2023
Question

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

  • February 10, 2023
  • 3 replies
  • 0 views

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

February 10, 2023

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

February 10, 2023

problem solved

peter.lewis
Employee
February 10, 2023

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]