Append Values

Certified Senior Developer

Hi,

I have a requirement to append the values of a particular computation to a local variable using append function 

The rule goes like this : 

a!localVariables(

local!data : {"x", "y", "z", },

local!finalValues,

a!forEach(

items: local!data,

expression: append(

local!finalValues,

performSomeComputation(fv!item)

)

)

)

now the problem is, the local variable is not getting updated no matter what, I tried using update dictionary as well as insert(local!finalValues, length(local!finalValues) + 1, fv!item) .. but still it wont append .. is there any other method I can use to append values ?

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    You would need to define local!finalValues as the a!forEach() update sequence you try below.  Expression code can't and doesn't "push" a value into an already-defined variable (the only exception being on a form where saves are executed via user interaction) - instead you need to build the update into your definitions.  It can be a tricky paradigm to get used to, I admit, but once you get it, it's pretty easy to follow.

Reply
  • 0
    Certified Lead Developer

    You would need to define local!finalValues as the a!forEach() update sequence you try below.  Expression code can't and doesn't "push" a value into an already-defined variable (the only exception being on a form where saves are executed via user interaction) - instead you need to build the update into your definitions.  It can be a tricky paradigm to get used to, I admit, but once you get it, it's pretty easy to follow.

Children