Automating Session Tracking in a Counseling Form

Hello everyone,

I need to create a form that includes an Individual ID field for counseling sessions. When a user enters an Individual ID, the form should automatically display the session number for that individual (e.g., “This is session number X”).

Since I cannot manually use the pull data function to retrieve previous records, I need a solution that dynamically references the currently recorded data to track session numbers accurately.

Could you please advise on the best approach to achieve this?

Thank you!

Hi @reza_82, Welcome to community!

You can check the documentation below, you can connect the data to itself. So you can count how many times that code appeared in the data set.

https://support.kobotoolbox.org/dynamic_data_attachment.html

1 Like

Thank you for the kind response, I have reviewed the link and it is all about linking to another project (child to parent), I didn’t find any solution to connect to the same dataset itself, appreciate if you elaborate

Hi @reza_82, it is the same logic as connecting to another project, you will just use the same form information for the child and parent form. Each side of the “=” should refer the same form

count(instance('survey')/root/data[P_Enumerator = current()/../P_Enumerator])

Thank you for the support, still not working. Would you take a look at the attached XML, regards Reza
instance_form.xlsx (9.2 KB)

Please first refer the topic below’s solution, it should help you to create what you need.

aUMdc5ASenv5223VbC3PrF.xlsx (9.2 KB)

1 Like