Problem with saving into array using a foreach

I have  an expression rule with the following code


ri!createdBy,
a!forEach(
items: ri!createdBy,
expression: rule!OBV_replaceNull(
fv!item,
loggedInUser()
)
)
),

I call it from an interface like this

rule!myER(createdby: cdtName.created_by), where cdtName is an array of cdt type

The problem is that every item in the resulting array contains all the values. So if it loops twice cdtname.created_by will look like this {username;username, username;username}. If I did just a save like this save(ri!createdBy, loggedInUser()) then it works fine. 

Running the for each alone seems to return the correct result within the expression rule. However, it is once I add the save into the rule input that causes problems. Has anyone run into this problem and found a solution?

  Discussion posts and replies are publicly visible

Parents Reply Children
No Data