Skip to main content
July 9, 2022
Question

Nested foreach

  • July 9, 2022
  • 6 replies
  • 2 views

I am trying to understand the working behaviour of foreach . i have tried this below code from appian doc.

a!forEach(
items: {"January", "February", "March"},
expression: a!localVariables(
local!month: fv!item,
a!forEach(
items: {1, 15},
expression: local!month & " " & fv!item
)
)
)

the code throws the below error.Kindly help.

6 replies

stefanhelzle0001
Brainy
July 9, 2022

By any chance, did you write this code directly in an Interface object? You foreach seems to be perfectly OK.

BTW, next time:

July 9, 2022

yes , i have directly written this code in interface. I will try insert code.Thanks for the response

stefanhelzle0001
Brainy
July 9, 2022

Either put your code into an Expression object, or create a!textFields or a!richtextDisplayFields in the inner foreach.