Cross-Survey References

Pull data from previously completed surveys for longitudinal studies and follow-up workflows.

Syntax and Requirements

Use the syntax {survey_reference:question_name} to pull data from previously completed surveys. Survey references are auto-generated (s1, s2, s3) when surveys are created and are displayed on survey cards. The referenced survey must have an approved response for the same paper. Question name must exist in that survey. This only works within the same paper context.

Syntax: {survey_reference:question_name}
References: Auto-generated as s1, s2, s3
Requirement: Must have approved response for same paper
Scope: Only works within same paper context

Examples

Reference baseline score: Your baseline score was {baseline:total_score}
Calculate change: {current_score} - {baseline:score}
Percentage change: ({followup:weight} - {baseline:weight}) / {baseline:weight} * 100

Cross-Survey Repeat Group and Table References

You can reference repeat group instances, table cells, and nested repeat group items from other surveys using the same bracket syntax with a survey prefix.

Repeat group instance: {s1:family[0].name} → first family member name from survey s1
All instances: {s1:family[*].name} → all family member names from survey s1
Aggregation: {s1:items[*].price.sum} → sum of all item prices from survey s1
Table cell: {s1:results[0].score} → first row score from table in survey s1
Table column agg: {s1:results[*].score.avg} → average score across all table rows

Cross-Survey Nested Repeat Group References

For surveys with nested repeat groups (a repeat group inside another repeat group), use the two-level bracket syntax with a survey prefix.

All outer, all inner: {s12:households[*].members[*].age} → all member ages across all households
Specific outer: {s12:households[0].members[*].age} → member ages from the first household only
With aggregation: {s12:households[*].members[*].income.sum} → total income across all members in all households
Count: {s12:households[*].members.count} → total number of members across all households

Use Case: Longitudinal Study

Survey 1 (Baseline) collects initial weight, blood pressure, and cholesterol. Survey 2 (Month 3 Follow-up) shows changes from baseline using syntax like "Weight change: {weight} - {baseline:weight} lbs". Survey 3 (Month 6 Follow-up) shows progress from both surveys: "Baseline: {baseline:weight} | Month 3: {month3:weight} | Current: {weight}". This approach is simpler than ODK's pulldata function, which requires CSV file setup and complex syntax like pulldata('baseline', 'score', 'paper_id', ${paper_id}). IDEAL automatically matches papers without additional configuration.