How to create a code for Fibonacci series in Appian
Discussion posts and replies are publicly visible
TEST_AddValueToLastInList(list, value): append(ri!list, reverse(ri!list)[1] + reverse(ri!list)[2]), reduce( rule!TEST_AddValueToLastInList(list:_, value:_), {0, 1}, enumerate(30) )
{0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368, 75025, 121393, 196418, 317811, 514229, 832040, 1346269}
can it be done using localVariables ?
As far as I can tell this function needs to be called recursively (or at least via the reduce() function), hence the expression rule 'TEST_AddValueToLastInList'.