Invalid index (4) for list: valid range is 1..3

Certified Senior Developer

I have the below mentioned throwing the mismatch error. pls guide

a!forEach(
items: ri!Addresslist,
expression: reduce(
a!update,
fv!item,
merge(
{
"AddressId",
"ReferenceId",
"Type",
"CreateBy",
"CreateDate"
},
{
if(
fv!item.AddressId = ri!primarykey,
null,
fv!item.AddressId
),
ri!Dependent[fv!index].AppianUserId,
"Permanent Home Address",
loggedInUser(),
a!defaultValue(fv!item.CreateDate, now())
}
)
)
)


Expression evaluation error at function a!forEach: Error in a!forEach() expression during iteration 4: Expression evaluation error at function 'merge' parameter 2 [line 14]: Invalid index (4) for list: valid range is 1..3

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Senior Developer
    in reply to Stefan Helzle

    a!forEach(
    items: ri!Addresslist,
    expression: reduce(
    a!update,
    fv!item,
    merge(
    {
    "AddressId",
    "ReferenceId",
    "Type",
    "CreateBy",
    "CreateDate"
    },
    {
    if(
    fv!item.AddressId = ri!primarykey,
    null,
    fv!item.AddressId
    ),
    ri!Dependent[fv!index].AppianUserId,
    "Permanent Home Address",
    loggedInUser(),
    a!defaultValue(fv!item.CreateDate, now())
    }
    )
    )
    )
    

Children