I can't speak for the details of your action (i.e. where the goal will come from), but I think what you're asking about is the condition. You'll need different rules with conditions such that:
- One rule executes on the first row
- One rule executes on subsequent rows
I'm attaching a very simple form with an example. The rules and conditions are on the field1 node. Youll see that one condition is:
count(../preceding-sibling::my:group2) + 1 = 1
(for the first row)
And the other condition (for subsequent rows) is
count(../preceding-sibling::my:group2) + 1 > 1
Hope this helps!