Dynamic Data Attachments - Form linked to itself


I’m developing an indicator collecting form with KoBo and I want to implement an indication validation mechanism into the form. For this purpose, I would like to use the dynamic data attachments function to pulling data from from the previous submissions of the same form.

I managed to link a form to itself with and if I try a formula like this: max(instance(name_of_the_project’)/root/data/updates_indicator5/indicator_5) it works. So it gives me the summa of the indicator 5.

But if I try this formula: max(instance(‘name-of_the_project’)/root/data[select_your_National_Society = current()/…/select_your_National_Society]/updates_indicator2/indicator_2) it seems there is no matching. So basically I want to pull the max number of an indicator from the previous submissions if the same option for the ‘select_your_National_Society’ select one question have been selected.

It seems the issues is about this part: /root/data[select_your_National_Society = current()/…/select_your_National_Society]/.

Do you have any idea what should be the problem?

Thank you in advance,

Welcome to the community, @Gisti! Have you tried as outlined in the support article?

You should be able to learn more from the article below:

@Gisti, try this and this should solve your issue:

In the survey tab of your XLSForm:

In the choices tab of your XLSForm:


Data entry screen as seen in Enketo: even when nothing is entered

Data entry screen as seen in Enketo: when something is entered

Data seen in the server:


Reference XLSForm:

Checking Max Integer (Case Management).xlsx (13.2 KB)