Copy and paste information from another form

Hi there,

I’m working on a KoboToolbox project and I need to copy a specific piece of data between forms. Each form has a unique ID that auto-increments, and I’d like to transfer this ID from one form to another.*Is there a way to automatically copy this ID value? I’ve considered using a calculated question, but I’m not sure if that’s the most efficient method.

Hi @segosal279,
Two things pop into my mind:

  1. last-saved
  2. dynamic data attachments

But I’m not sure if you’ve looked into those as solutions, and whether they’re right for your setting/context/workflow.

It would be helpful to know:

  1. How are you creating the auto-incrementing ID number?
  2. Is the data being submitted all through the same device? (where last-saved might be a good solution)
  3. What type of device are you using for data collection, Android or Enketo?
  4. How much time lapses between two submissions (relevant for dynamic-data attachments, as a minimum amount of time is required between submissions)?
  5. Will you have full connectivity during data collection? (relevant for dynamic-data attachments, as you need to be able to access the server for prior submissions)

Hope this helps as you start to think of a solution?
Janna

1 Like

Hi Janna,

Let’s break this down step by step.

  1. Auto-incrementing ID: I’m using a calculated question with the formula if(${last-saved#id} = '', 1, ${last-saved#id} + 1) to generate a unique ID for each submission.
  2. Device diversity: Submissions are coming from various devices.
  3. Device type: All data collection devices are Android.
  4. Submission frequency: The time between submissions ranges from 40 minutes to 24 hours.
  5. Connectivity: Approximately 90% of submissions occur with full connectivity.

Hi @segosal279,
Very clear!

So, just to be clear, your incrementing ID number is going to be 1, 2, 3, 4, 5, etc. But that will be from each device, correct? So you’ll end up having multiple ‘1’ IDs, multiple ‘2’ IDs, etc. Am I understanding that correctly?

last-saved only works for each unique device, so, for example, you won’t be creating unique ID values across all devices.

I wonder if there is a way to combine something like auto-incrementing number (per device, as from your example), and then concatenate that with date and deviceid/collectid, for example, to create a unique identifier across all devices?

Anyway, that’s something to think about, and maybe you have thought about that already, but now on to transferring that ID number from one form to another. If you want to essentially ‘copy’ data from one form to another form, dynamic data attachments allows you to ‘connect’ two (or more) forms together, like parent and child forms.

However, in order to do this, you need to essentially have your ‘ID’ number input into the ‘child’ form, and then the child form will be able to ‘lookup’ that ID number in the parent form and pull over the data from that parent form into the child form.

So in essence, you’d need to enter the ID number into the child form. You cannot have a ‘lookup’ field in the child form that would allow you to scroll through all the ID numbers in the parent form and choose the one you want.

Does that make sense? The documentation for dynamic data attachments is here, and here is a video tutorial walking you through it.

Not sure if this helps, but let us know if it provides a solution!

1 Like

@janna, @segosal279 this post discussed previously should be able to help you get a unique id using both the last-saved function and the concat function:

1 Like