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
  • Hi Mike,

    I think you can use load() and dictionary syntax to accomplish this. Try something like:

    load(
              mycdt:<expression to initialize mycdt>,
              if(
                        not(<corner case expression>),
                        local!mycdt,
                        {field1:local!mycdt.field1, field2:local!mycdt.field2, field3:0}
              )
    )

    It will be a bit tedious to type out all 40 fields, but this should get your desired result in 1 expression.
Reply
  • Hi Mike,

    I think you can use load() and dictionary syntax to accomplish this. Try something like:

    load(
              mycdt:<expression to initialize mycdt>,
              if(
                        not(<corner case expression>),
                        local!mycdt,
                        {field1:local!mycdt.field1, field2:local!mycdt.field2, field3:0}
              )
    )

    It will be a bit tedious to type out all 40 fields, but this should get your desired result in 1 expression.
Children
No Data