How to create a Main form which is relates to sub Form

Hi All,

This is Chandrasekar. In my form I have lot of fields to enter the data. I need to be precised the form which like similar to Parent and Child relationship. How can i achieve this one. One main form which is related to the sub form. Please give me the possible solutions. Why because i have to integrate ODK to salesforce thats why I have gone with these options.

Give me some feasible solutions with example

Thanks,
Chandrasekar

The documentation is a great source of information on ODK. The feature I think you would be interested in is entities: https://docs.getodk.org/central-entities/

This forum is good for asking specific questions. It helps when you can explain what you have already tried, what you expected to happen, and what went wrong.

It can also be interesting to use the search function to find related conversations. For example, if you search "salesforce integration" you'll find posts where people have discussed that topic: https://forum.getodk.org/search?q=salesforce%20integration

1 Like

Another way to look at this might be to use repeat groups.... https://docs.getodk.org/form-logic/#repeating-questions

The 'main form' (Parent) allows you to ask about (for example) a household, and then you add a repeat group, which creates Child 'forms' that allow you to ask about each member of the household.

This may be easier than implementing entities (but then I am very cautious ODK user :slight_smile: )

The output (from Central) could be 2 csv files - one for the 'main form' with a field KEY, and the other for the repeat, with PARENT_KEY field to link to the 'main form' and KEY for the id of the Child record.

But entities might be a more powerful option depending on your needs - I don't know salesforce and its capabilities or requirements...

1 Like

Hi @danbjoseph

Thanks for the replay. Can you please share one basic example form for the entities features. so I have a better understand or else if you have connect with me. Please tell me your convenient time.

Thanks
Chandrasekar

Hi @seewhy

Thanks for the replay. Can you pls share me the example of these parent and child forms.

Thanks
Chandrasekar

Here is a very simple version of how you would construct the form with a main section (Parent) and repeat group (Child). I used the template - you will find this helpful when constructing new forms - there is lots of guidance within it.

ODK XLSForm Parent-child-form-example.xlsx (574.7 KB)
Please also refer to documentation that I previously linked to for further details.

1 Like

Hi @seewhy

Thank you so much for your relpay.

main_form.xlsx (14.7 KB)
DDPC_school_visit.xlsx (12.5 KB)

So my use case is like in the choose activity I have one of the options called school visit. Make the main file as parent and ddpc_school_visit as child.

in the main form when i click the school visit , it will opens the sub form to enter those details or which options is feasible to use. can you pls suggest me on that.

Thanks
Chandrasekar

Hi @Chandrasekar_ganesan
I'm afraid I can't easily follow your work-flow from the spreadsheets provided - which means I am struggling to see what you are trying to achieve. There seem to be blocks of questions that are not clearly related (including ones from my example), and I cannot obviously see the relationship between your two spreadsheets. In my scenario it is a single form, which is useful for collecting initial data, rather than revisiting existing data.

It looks like you are trying to combine different approaches to data collection and perhaps more in the realm of 'case management' rather than a just Parent-Child relationship. If I am correct, you probably need to learn about entities...

This might be useful start point: https://docs.getodk.org/tutorial-community-reporting/

But also you may be able to get better help through the Forum if you can explain your work-flow more clearly.

Please bear in mind that people are more likely to help with 'How do I solve this part of my problem?' rather than 'How do I use ODK to fulfil my goal?'

Respectfully,
SeeWhy

2 Likes