I have a form which sits at the chv profile level and there are some questions in the form which are supposed to be asked starting from second visit onwards.
I created a function in contact-summary-extras
to count the number of forms submitted for a particular chv and return the count value in the form.
The function however always returns 0 even though I have already submitted the form. I can see the document I submitted in couch.
I submitted the form using a user with supervisor
role.
Can you help me identify the cause of the issue?
Here’s the function:
getQualityMonitoringCount: function() {
console.log(reports.map(r => r.form)); // returns nothing
console.log(reports); //returns nothing
return reports.filter(r =>r.form === 'chv_quality_monitoring').length;
},