Help with modifycontent in tasks

I’ve a code that works as expected but I do not undestand why, so I need your help to figure out what is doing this code

With a task that appliesTo reports of type ‘patient_assessment’ , the patient_assessment form doesn’t have a field follow_up_count, the task action is defined as:

 actions: [{
      form: 'referral_followup,
      modifyContent: (content, contact, report) => {
      const followUpCount = parseInt(getField(report, 'follow_up_count'), 10) || 0;
      content.t_follow_up_count = followUpCount + 1;
    }],

if referral_followup form doesn’t have a follow_up_count field, the t_follow_up_count variable passed to the form has always the value 1, and this is clear, but if the referral_followup has the follow_up_count, the t_follow_up_count variable passed to the form has incremental values as expected, 1,2,3…

In my understanding in the user device the reports will be processed one by one and only patient_assessment reports will be processed, since patient_assessment report has never the field follow_up_count the const followUpCount will be 0 and the content.t_follow_up_count = followUpCount + 1 will be allways 1 but this is not happening

Are you sure the task does not apply to reports of another type?
Sometimes, it is configured so that a follow-up report can trigger the next follow-up task.
In that case, you would have the follow_up_count in your report incremented.

Consider this example:

Task source Task action Follow up count
Patient assessment Patient followup (1) 1
Patient followup (1) Patient followup (2) 2

@binod
Sometimes, it is configured so that a follow-up report can trigger the next follow-up task

Yes I think that the example is just our use case but I will want to know how ca be configured that the follow-up report can trigger the next follow-up task ?

Thanks