Is 2 operations within the same expression in a for each loop possible?

Can we perform 2 operations within the same expression of a forEach loop possible? (Ex: zip in python.)

  Discussion posts and replies are publicly visible

Parents Reply
  • hi  , see if this helps.

    a!localVariables(
    local!var1: { "John": "A", "Sam": "B", "Rose": "C" },
    local!var2: { "Smith": 1, "Williams": 2, "Thompson": 3 },
    local!var1Values: a!flatten(
    a!forEach(
    items: a!keys(local!var1),
    expression: if(
    fv!isLast,
    stripwith(keyval(local!var1, fv!item, ":", ","), "]"),
    keyval(local!var1, fv!item, ":", ",")
    )
    )
    ),
    local!var2Values: a!flatten(
    a!forEach(
    items: a!keys(local!var2),
    expression: if(
    fv!isLast,
    stripwith(keyval(local!var2, fv!item, ":", ","), "]"),
    keyval(local!var2, fv!item, ":", ",")
    )
    )
    ),
    merge(local!var1Values, local!var2Values)
    )

Children
No Data