How to pass data from one form to another in ODK Collect

Hi Everyone,

I have created a form to capture user activities (e.g., training, meetings, etc.). Based on the user's selection of an activity, I need to programmatically redirect them to another form, seamlessly, without requiring any manual intervention or making the redirection noticeable to the user.

Could anyone suggest an efficient way to implement this? If possible, please share an example to help illustrate the approach.

How i need output, Similar to RDBMS data model

Form 1
image

Form 2

image

Regards,
Afrose

Hi @Afrose_ahamed ! :wave:

I was wondering if it might be possible to merge two forms into a single one, especially in cases where one form is being filled out immediately after the other. If that’s feasible, we could simply use the "relevant" column to separate the questions based on the selected (or mentioned) activity, like this:

Survey Sheet:

type name label required relevant
select_one activity_type ac_type Select type of activty yes
text q_t Who given the training? yes ${ac_type} = "training"
text q_m Who conducted the meeting? yes ${ac_type} = "meeting"

Choices Sheet:

list_name name label
activity_type training Training
activity_type meeting Meeting

Let me know if this approach works for your case. Wishing you a wonderful day ahead!

Hi,
You might want to look at entities for this use case. However, I believe you could also group your questions then have everything under a single form, with the appropriate skip logic. In that way, a training group of questions will for instance only be visible to workflows selecting training in the first section.

I Agree, But the problem using single with relevant making difficult in submitted form.
let say in each activity i have 50 fields. if we submit select activity capture but other activity fields are showing as blank(250 columns showing in submission form) so its very much difficult to generate report or when auditing

Yeah i thought entities, not sure how to do for my requirement because its needs redirection to another form without user interaction, im not sure this is how entities works correct me if am wrong, In entities initially we submit data on parent form again user have to select manually in child form to see the parent data.

1 Like

If two separate forms are being used here, data collectors would need to manually select and start a new form (the child/secondary form) after completing the initial form (the parent/primary form). However, if you'd like to avoid this extra step for data collectors, the best solution would be to merge the two forms into one. As far as I know, ODK Collect doesn’t currently support automatically launching a new form once another form is completed.

So, you have two options to consider in general:

  1. Data collectors can start the new child form manually after finishing the parent form. If you go with this approach, using entities might help (and it’s worth checking out offline entities for this as well).
  2. Merge the two forms into one so that data collectors can transition seamlessly between sections without noticing any difference.

If you're concerned about handling blank responses:

  • This is where data analysis tools come in! ODK Central provides access to OData feeds or API endpoints, which you can use with tools like Power Query in Excel to clean up and automate your reporting.

I hope this helps! :blush:

1 Like