Is there a way to declare an empty array as a local variable (local!a) --> Perform some operations in another local variable(local!b) and append the results to local!a.
Discussion posts and replies are publicly visible
No. Variables in Appian are immutable, following the functional paradigm of the SAIL expression language. But you can just create a new variable holding the values. And, you do not have to declare a local variable, just to define the output of your expression.
As Stefan mentioned already, no. You're thinking about it backwards. There's no need at all to "declare" an empty value for "a" if you're just going to go on and perform some calculations: perform your calculations first, then declare your local variable based on that result.