What do you need help with?
Search the knowledge base, browse our resources, and visit our forum for more detailed information
Search the knowledge base, browse our resources, and visit our forum for more detailed information
Last updated: 5 Aug 2021
This support article illustrates how data from one project can be linked dynamically and referenced by other projects. It also aims to demonstrate some practical examples that this feature supports.
Dynamically linking projects allows for the same powerful capabilities as the
pulldata()
function but without the need to
maintain a separate CSV file since the data stored in a linked project acts as
the data source. Users can continue collecting data in the parent project and
simultaneously use that data in other linked child projects, therefore enable
creation and management of longitudinal survey projects (longitudinal data is
collected through a series of repeated observations of the same subjects over a
short or long period). Users can also dynamically link a child project with a
shared parent project.
Users can retrieve any (non-media) responses (text
, integer
, decimal
,
select_one
, select_multiple
, etc.) in a linked child project (Round 2 in
this example) that has already been collected and stored in the parent project
(Round 1 in this example).
Users can also perform various calculations on linked
data in the child project, such as counting (count()
) responses and
computing the sum (sum()
), maximum (max()
), or minimum (min()
) value of a
particular variable.
Dynamically linking projects requires a parent project and at least one child
project. The
parent
project requires no additional modification from a normal XLSForm; however,
the
child
project involves adding an xml-external
question type. All subsequent
references to the parent project occur in the calculation
column using the
node path.
Users could design their parent project as shown in the image below:
In the same way, users could design their child project as shown in the image below:
Note: The name used for the
xml-external
question type in the child project is crucial for linking with the parent project. In the above example, it was named “survey”, but it can be any name consisting of Latin characters and numbers.
calculation
column of the child project¶XLSForm Syntax |
Description |
---|---|
|
Return the total count of |
|
Return the total count of where |
|
Return |
|
Return |
|
Return |
|
Return |
|
Return the sum of |
|
Return the maximum value entered in |
|
Return the minimum value entered in |
|
Return |
|
Return |
Users can link projects dynamically in two scenarios:
The same user owns both the parent project and child project, and
Different users own each of the projects and the parent project is shared
Follow the steps below to dynamically link projects:
Step 1: Upload and deploy the parent project.
Step 2: Enable data sharing with child projects by toggling the Data Sharing switch in the parent project’s SETTINGS>Connect Projects section (disabled by default), and click ACKNOWLEDGE AND CONTINUE in the confirmation modal. Users can then restrict specific variables to share with child projects or share all variables from the table by toggling the Select specific questions switch.
Step 3: Upload and deploy the child project.
Step 4: In the child project’s SETTINGS>Connect Projects, click the
Select a different project to import data from dropdown menu and select a
parent project to link. Rename the linked parent project to the same
xml-external
question name defined in the XLSForm (“survey” in this example)
and click IMPORT. You can then select specific variables from the parent
project to share with the child project.
The child project now has access to data from the parent project. In this example, data from the Round 1 Survey is linked to the Round 2 Survey.
Assume a scenario where userA has a parent project shared with userB. userB can create a child project and link it dynamically with that project. For example:
Step 1: userA should follow Step 1 and Step 2 of Both Projects Owned by Same User to upload, deploy and configure the parent project.
Step 2: userA should then share the parent project with userB and grant the minimum permissions of: View form and View submissions. userB can now dynamically link their child project to the parent project of userA.
Step 3: userB should now upload, deploy and configure their child project as outlined in Step 3 and Step 4 of Both Projects Owned by Same User.
Users can collect data for dynamically linked projects on both the Collect Android app and Enketo web form.
Please note the following when collecting data:
At least one submission must be present in the parent project for the child project to function as expected.
There is a five-minute delay syncing the parent project’s updated data with the child project.
Frequently download the child project in Collect or Enketo (when in offline mode) to ensure the data is in sync with the parent project*
*One can configure the Collect Android app, with an internet connection, to update the parent project’s data automatically in General Settings>Form management>Blank form update mode>Previously downloaded forms only or Exactly match server. Note that enabling this setting could drain your device’s battery faster than usual.
In this example, some “dummy” entries have been made in the parent project.
With some dummy entries in the parent project, the child project can now see that data during data collection. In this example child project (Round 2 Survey), only the two fields of Enumerators name and Identification Number are entered manually while the rest is linked automatically with the parent project.
Did you find what you were looking for? Was the information clear? Was anything missing?
Share your feedback to help us improve this article!
KoboToolbox is maintained by Kobo Inc.