Using the new a!update()

Certified Senior Developer

Is is possible to update multiple fields of a CDT using the a!update()? The documentation shows that you can for a regular array, but with the CDT examples shown, it only updates one field at a time. When I test it out in an expression, it throws an error. I just want to check that I'm not missing anything here. 

e.g. 

a!update(
  data: ri!submission,
  index: {"StatusID", "SubmissionTypeID"},
  value: {1, 2}
)

error thrown: Expression evaluation error at function a!update: Invalid index: cannot index multiple indices of type List of Text String into type CRA_T_Submission

 

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Lead Developer

    I have reported this to Appian recently, because I found the same issue with testing.  It throws the same error when you try with either a Dictionary or with a CDT (surprisingly), but works if you feed it a MAP specifically.  Which is weird.  I was really looking forward to replacing the "update dictionary" plug-in, but as it stands, a!update() is not usable for that in 99% of my current use cases.

    Working (a!map):

    Not working (dictionary):

    Edit to add in retrospect: as of 21.4, the nonworking cases I mentioned earlier now seem to work.

Reply
  • +1
    Certified Lead Developer

    I have reported this to Appian recently, because I found the same issue with testing.  It throws the same error when you try with either a Dictionary or with a CDT (surprisingly), but works if you feed it a MAP specifically.  Which is weird.  I was really looking forward to replacing the "update dictionary" plug-in, but as it stands, a!update() is not usable for that in 99% of my current use cases.

    Working (a!map):

    Not working (dictionary):

    Edit to add in retrospect: as of 21.4, the nonworking cases I mentioned earlier now seem to work.

Children
No Data