Skip to main content
Known Participant
Jul 9, 2022 7:27 PM UTC
Question

Nested foreach

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
Jul 9, 2022 7:52 PM UTC

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

BTW, next time:

Known Participant
Jul 9, 2022 7:54 PM UTC

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

stefanhelzle0001
Brainy
Jul 9, 2022 7:55 PM UTC

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