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
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()) } ) ) )
Seems like that your rule inputs AddressList and Dependent are not of the same length.
ya addresslist carring 4 items in it while dependent ruleinput carry only 3 items.