Hello all, I have an expression rule which looks up (via query) and then re

Certified Lead Developer
Hello all,
I have an expression rule which looks up (via query) and then returns a single member of a CDT array. My issue is that there is one corner case in which I would like to override one specific element in that CDT as it's returned, but for the life of me I can't figure out any workable way to do this. Any suggestions, or is it even possible?...

OriginalPostID-72086

OriginalPostID-72086

  Discussion posts and replies are publicly visible

Parents
  • A minor adjustment to Andrew's response. Firstly, in this case it wouldn't make a difference if you use with() or load() - forum.appian.com/.../Evaluation_Functions. What I would do is with( mycdt: <expression to initialize>, if(not(<corner case exp>), mycdt, type!CDT_NAME(field1: mycdt.field1, field2:mycdt.field2 ..... ) ) You need the type! constructor to cast your results to the CDT type. If you have never used a type constructor, I would recommend going to the expression editor and seeing what happens when you write type!CDT_Name(). Then play around with that...do type!CDT_Name(field1: "test") etc. Hope this helps.
Reply
  • A minor adjustment to Andrew's response. Firstly, in this case it wouldn't make a difference if you use with() or load() - forum.appian.com/.../Evaluation_Functions. What I would do is with( mycdt: <expression to initialize>, if(not(<corner case exp>), mycdt, type!CDT_NAME(field1: mycdt.field1, field2:mycdt.field2 ..... ) ) You need the type! constructor to cast your results to the CDT type. If you have never used a type constructor, I would recommend going to the expression editor and seeing what happens when you write type!CDT_Name(). Then play around with that...do type!CDT_Name(field1: "test") etc. Hope this helps.
Children
No Data