New Support Article: Dynamic Data Attachments [Case Management]

Yes I did,
There is a problem also I realized as follows:
I used auto generated ID using date time calculation (format-date-time(now(), ‘%d%H%M%S’)
when I am trying to retrieve data using the same number it is not working … I just removed this and used static number … it worked !

2 Likes

Hello @iyadhoo,
This is an expected behaviour. The calculation will be redone, on open/save.
You may need to use once(now…).

3 Likes

@Kal_Lam is there yet a solution for this?

Not yet @mikev897! We will update this post whenever we have an update for this.

1 Like

Dear all

I am still struggling to understand the basic mechanism of this new feature and would be very happy, of someone could explain.

I understand that data collected in a parent project can be dynamically “pulled” (no csv needed) into the form of a child project (already not sure whether this requires online connection or whether all data from the parent are stored when refreshing GetBlank Form, which would strongly increase the size of the form). If I had a situation that the same form is applied in clearly distinct rounds (one after the other), this approach seems to be very useful. However, we have “overlapping rounds”, i.e. one site is visited for the seventh time when another is visited for the second time. The time between visits can vary strongly. With other words: We would have to define a new child project every three days or so.

What we need is not an (endless) sequence of child’s children, but a loop: The parent is the child of itself, so that the form can show the entry of the same form when it was used the last time.

Possible?

Yes, this is possible and we will be updating the article soon!

Oh, quite surprising, but definitely fantastic news that it already IS possible (and only the guidance is missing). Great!

Is there a draft of this section of the support article? We would be happy to test it and help to fine-tune…

The level of suprise has increased after testing the currently described parent/child feature: I really wonder how multiple forms (from repeated visits) with the same identifier (school id, in our case) can be handled. The described setup leads to an error message for this:

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!

3 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