Mutate a dictionary or map.

As an example, in Javascript I can do this:

var test = {a:1,b:2}
test.a = 'changed'
console.log(test)

and it will output this:

{a:"changed",b:2}

Because I mutated the value in key 'a' of the test variable.

How do I do this in an appian expression?

Trying this:

a!localVariables(
  local!test: {a:1,b:2},
  local!test["a"]: "changed",
  local!test
)

Gives me this error:

Expression evaluation error at function 'localvariables': A variable is incorrectly defined. Parameter: 2. Expected syntax: localvariables(local!a, ..., expr) or localvariables(local!a:10, ..., expr)

So it seems you can't changed a key of a variable in an expression. Is there another way to do this? It seems like such an elementary operation...

  Discussion posts and replies are publicly visible

Parents Reply Children
No Data