Adding rows in one object based on another

You have to add a “nameFieldValue” parameter with the owner name. So basically you would add a variable for the name in the loop:

var ownerName = reps.getFieldValue(row,'Owner.Name');


and then change the last line to this:

{ field: 'OwnerId', value: theowner, operator: '=', nameFieldValue: ownerName}