Print number Patterns

How can we show output as given below in appian using expression rule?

output:

1

22

333

4444

55555

  Discussion posts and replies are publicly visible

Parents Reply
  • Those were the answers for the initial question:

    For star pyramid:<I have used 2 loops, although i believe it can be reduced to one>

    a!localVariables(
      local!input: 5,
      local!rows: where(mod(enumerate(5) + 1, 2)),
      local!star: a!forEach(
        items: local!rows,
        expression: concat(repeat(fv!item, "*"))
      ),
      local!space: reverse(enumerate(length(local!star))),
      a!forEach(
        items: local!space,
        expression: concat(rept("-", fv!item), local!star[fv!index])
      )
    )

Children