Skip to main content
Inspiring
Sep 19, 2023 10:39 AM UTC
Question

can we declare local variables inside a!foreach()

can we declare  local variables inside a!foreach() inside expression rule 

    3 replies

    stefanhelzle0001
    Brainy
    Sep 19, 2023 10:50 AM UTC

    Yes

    rishikeshr4182
    Inspiring
    Sep 20, 2023 6:46 AM UTC

    Yes, [mention:0591d80bf3a5406ebeb3855605fe90c0:e9ed411860ed4f2ba0265705b8793d05], we can do that,
    #For your reference, a small example.

    a!forEach(
    items: { 1, 2, 3, 4 },
    expression: a!localVariables(
    local!index: fv!item,
    a!forEach(
    items: { "A", "B", "C" },
    expression: concat(fv!item, local!index)
    )
    )
    )

    Rishikesh
    anmolv0003
    Participating Frequently
    Sep 20, 2023 6:47 AM UTC

    Anmol