Script for online form with nested repeats

274
3
12-12-2023 07:34 AM
NevilleCTT
New Contributor II

I am developing a Population Census form in Connect for individuals in a household and I using nested repeats for the various section(Health, Fertility, education, Economic activity, etc) questions for the household members. The form will be used on mobile devices and online. I am unfamiliar with javascript and Json. I am using a parent repeat to capture the name, ages, sex of the household members.

I will like to put the parent repeat information in an array with the position of each person in the repeat as the "id" in the array so that can be used to pulldata Json record calculation to get the name, age and sex in the child repeats below.

Can the same script be used on the online form and on the mobile device? Or do I have to create a separate form for online and another for the mobile device?


Can anyone share the script that I can use in Json pulldata calculations to use this information in the child repeats(Health, Fertility, education, Economic activity, etc)?

0 Kudos
3 Replies
abureaux
MVP Regular Contributor

I'm stuck in calls for a while so can't dive too deep yet, but curious if you have considered indexed-repeats and pulldata rather than java?

0 Kudos
NevilleCTT
New Contributor II

I have begun testing the function and it seems to work fine, does the indexed-repeat function work in online public forms?

0 Kudos
abureaux
MVP Regular Contributor

Yep. They also work for anonymous users.

JS functions require an account to work (security precautions).

0 Kudos