ODK-X referencing data in a parent form

1. What is the problem? Be very detailed.
I need to look up information in a parent table and display the value on the follow up forms. For example, my main form is a woman form. I collect initial demographic information: name, age, researchArm and assign a studyID. My follow-up form is asked 2-3 times. On each visit, I create a new follow-up form linking on the studyID. As one of the note type prompts, I’d like to display some text to confirm the woman: “Please provide the answers for Woman [show name], Age: [age], Research Arm: [A].” How can I look up the referenced values in the woman table for Name and ResearchArm so they can be displayed? I thought I could use queries, but this seems to be designed for requesting or generating a list of records. I only need one record.

2. What app or server are you using and on what device and operating system? Include version numbers.
ODK-X, ODKSurvey, ODKTables

3. What you have you tried to fix the problem?
I tried using “queries” worksheet

4. What steps can we take to reproduce the problem?

5. Anything else we should know or have? If you have a test form or screenshots or logs, attach below.

Hi @fvandyk! You are on the right track with queries!

So you need to map down the data from the woman form into the follow up form. When you do the linked table that has all of the visits, you need in the queries sheet to map those values in the newRowInitialElementKeyToValueMap column. You will also need to put them in the model sheet of your sub-form so that those variables are “in” the table to put the mapped data “into”
See:
https://docs.opendatakit.org/odk-x/xlsx-converter-reference/#id15
for a bit more discussion

It looks like the linked table only works in a SELECT type prompt. I’d like to use it in NOTE. Does it only work in a SELECT type? Do you have any examples with it in a NOTE type? I understand the part about adding it to the model worksheet.

Thanks!!

Hi @fvandyk! So the data, such as age, (once it is in your model/table) can be a note – it does not have to be a select of any kind. See in this example of a sub-form: quest1_03_0.xlsx (55.2 KB) we use the q100 (household id) that got mapped down from the form to display in a note: Household No. – {{data.q100}}

Hi Caroline, Thanks for this!
I finally understand. I probably should have mentioned that I’m launching the subform from Javascript in ODKTables. Now I see that I can map multiple fields in the addRowWithSurvey function.