Problem updating new row in SubForm

Problem updating new row in SubForm

I have created a form that contains a SubForm. I have actions through a workflow that automatically set field values, for example:

Form > Created or Edited > User input of SubForm.Frequency > Calculate Next Date
  1. if (SubForm.Frequency == "Annually")
  2. {
  3.    input.SubForm.Next_Date = input.SubForm.Date.addMonth(12);
  4. }
This works as intended and updates the field value for the first row entered; however, if any additional rows are added, the first row values are updated based on actions in the second row (i.e., if the frequency is changed, the first row Next Date is updated, not the current row's Next Date).

I am assuming that this is caused by not identifying the current row the user is working in, but I am unable to find any resources for identifying the current row.

What am I missing?