New Support Article: Dynamic Data Attachments [Case Management]

Dear kobotoolbox team

Can you already tell when the anounced article (parent child LOOP) will be available?

@york_rff, updating the article should be quick, but there are still issues when you edit the submissions for such linking (linking the same project dynamically). Thus this is why we have not updated the same at the moment. Thank you for your kind understanding!

2 Likes

Dear Kobo team,

I designed a repeated form to collect household information (parental project). Each individual in-household will have a unique ID (pid)
Then I designed a form to collect KAP of every adult in the household (child project). I want it pull all information (gender, age…) from individuals in parental project when the pid is entered.
I tried command like this, but it did not work

instance('parentproject')/root/data[hh/pid = current()/../pid]/hh/name

Which command I could use in this situation?

@kienl, do you mean you wish to dynamically link a project with another project from a repeat group? If yes, please be informed that this feature is not supported yet.

1 Like

FYI for everyone in this thread who expressed interest in having the dynamic attachments feature worrk for select_one / select_multiple questions, Kal has turned this linked thread into a feature request that you can all vote for!

1 Like

Hello @yjouanique, @Kal_Lam,
Am I right that a calculate type can use the dynamic attachment feature? As workaround, this value could then be used to set a select variable in the form.

1 Like

My understanding is yes, you can calculate a single variable, and set it as the value for a select question.

What you cannot currently do is use it as a source of all the available options list.

1 Like

Hello @yjouanique,
Sorry, did not well understand what you exactly want to do. Create/copy dynamic choice labels from an external source? Use an external “choice list” directly in the form?
(How would like to get choice labels in this case?)

@wroos, let me try to explain what @yjouanique has proposed.

Suppose you have a text question (let’s assume it’s Q3. What is your favorite holiday destination?).

Now, respondent 1 inputs Nepal in Q3 in form 1, respondent 2 inputs Thailand in Q3 in form 2, respondent 3 inputs Dubai in Q3 in form 3, respondent 4 inputs Singapore in Q3 in form 4.

Following your approach, you will only be able to get the current holiday destination you entered in Q3. Let’s say if you entered Nepal in Q3, you will be able to display Nepal in your question where you linked it by the calculate question.

But, @yjouanique wants to display all these choices collected by respondent 1, respondent 2, respondent 3, and respondent 4 as a select_one or select_multiple choices using this dynamic attachment feature. So the option for the desired select_one or select_multiple question for the desired question would be 1. Nepal, 2. Thailand, 3. Dubai, 4. Singapore in a dynamically linked project.

So the idea here is that Q3 will be called in a parent form, and then the options should be displayed in the child form.

I hope I understood you correctly @yjouanique! Feel free to correct me if I misunderstood you at some point.

1 Like

Thanks @Kal_Lam,
And probably the relating choices list should not include duplicates? For example, a respondent 5 selected Nepal in Q3 also, but Nepal would only be once in the new list (i.e. select distinct … in database words).
Kind regards

1 Like

Dear Kalyan, any news on the article update?

Kind regards
York

1 Like

Sorry, @york_rff, the feature still needs an update that has not been made yet. Hence the update of this article is still pending!

1 Like

Please, were you able to sort the duplicate issue? I think I have a similar problem with a working form.

Dear snillok4u

Unfortunately, we are still waiting for the update of the respective support article (see message of @Kal_Lam from July 8).

Kind regards
York

1 Like

Thank you. I will wait then. Thought you found a different approach to solve the duplicates.

Please, when there is a group inside a group, what should the code look like?

I have done a form working, but i needed to make a group of questions a field-list, hence, the dynamic code is not calling the entry from the registration form.

This works:
instance('cpickup')/root/data[reg/family_number = current()/../pickup_number]/reg/child_1

Having included a group, I tried this and it didn’t work:
instance('cpickup')/root/data[reg/family_number = current()/../pickup_number]/reg/child_1grp/child_1

Dear @Kal_Lam i read your suggestion it was very helpful. I have successfully test and connect parent and child projects. However my requirement is with only one form doing 1st & 2nd survey and need to be connected to the current project dynamically and get past data that summitted previous data from the first survey . Please look as the survey questions below

  • The form just start by specifying the following:
    • First Visit
    • Second Visit
      And expect the phone number on the second survey to fitch the data from the first survey.
      Kindly help!
      Thanks in advance,

thank you all i got this link and was very helpful, i solve my problem here

1 Like

can we do that now?
or we will wait until the next update?

Welcome to the community, @salaheddinieyyubi! Could you kindly explain your issue in more detail so that the community should also be able to help you out?