double layer of a!forEach

for exmaple:

value:fv!item.value,

saveinto:{a!save(target:ri!value,value:a!forEach(

items:local!rule,

expression:if(

outside fv!item.value=inside fv!item.value,null,null

),

Then how i express?

))}

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Lead Developer

    If you need to nest an a!forEach() inside another a!forEach() and want to refer to the outer fv!item, you can either put it in a local variable before calling the second a!forEach() or put the inner call in a separate rule and pass in fv!item via a rule input. For example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    
    a!forEach(
      items: {"January", "February", "March"},
      expression: a!localVariables(
        local!month: fv!item,
        a!forEach(
          items: {1, 15},
          expression: local!month & " " & fv!item
        )
      )
    )
    

    The above expression returns a three item list containing {"January 1", "January 15"}, {"February 1", "February 15"}, and {"March 1", "March 15"}

Reply
  • +1
    Certified Lead Developer

    If you need to nest an a!forEach() inside another a!forEach() and want to refer to the outer fv!item, you can either put it in a local variable before calling the second a!forEach() or put the inner call in a separate rule and pass in fv!item via a rule input. For example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    
    a!forEach(
      items: {"January", "February", "March"},
      expression: a!localVariables(
        local!month: fv!item,
        a!forEach(
          items: {1, 15},
          expression: local!month & " " & fv!item
        )
      )
    )
    

    The above expression returns a three item list containing {"January 1", "January 15"}, {"February 1", "February 15"}, and {"March 1", "March 15"}

Children