Sure, here it goes!
As bit of context, you can have a look at this discussion here, which describes what you are trying to do, and where one person gives another workaround which could be of use to you:
Using dynamic data attachment to populate choice lists for select_one and select_multiple fields. Back then (2021), the feature you are describing was not available, and as far as I know, it still isn’t (that discussion explains why it is very hard to implement).
Summary of my workaround:
Instead of dynamic data attachment, In project B, I use external CSV file (via “select_one_from_file”, which contains the list of product ID generated in project A. I have a process that completely automatically, and regularly, update the .csv abased on the data available in project A.
Main limitation:
This is not a perfect solution:
- It requires a bit of coding: you will have to some level of understanding to be able to replicate it.
- The .csv file is updated regularly (adjustable frecuency), but not live
- Updating the CSV requires an internet connection (upload new data in project A, update the .csv file, and update the project B form).
How it works:
Data is collected and project via project A.
- I have an export to xls for project A (On Kobo: Form -->Data -->Download)
- I import that raw data into a Google Sheet (via a call to the Kobo API and a bit of Google App Script)
- My google sheet is set-up to reformat the raw data from project A into the format that the .csv file for project B (select_one_from _external)
- I have another bit of GAS code that automatically downloads the formatted data in a .csv file on my hard drive.
- Finally, I have a python script that update project B on Kobo’s servers by uploading the new version of the .csv file
- Everything is run automatically: (the GAS code via the time-trigger available through Google App Script, and the python’s script via Windows’ task scheduler).
As you can see, this is a tad convoluted. I am no professional developer, but this approach fits my needs (and hopefully, yours). In my context, there is about 1 year between the moment where a code is generated in project A, and when this code is needed in project B. My .csv file updates once per day, which is way more than good enough.
That frequency can be adjusted up or down, but again, it is not live (which is what we could get if DDA allowed us to do that).
The Google Sheet / GAS intermediate made sense in my context (I had to export everything to Google anyway), but is probably not necessary. I am fairly confident that you could do everything via a single python script, that downloads the data, format it into a .csv file and uploads it to Kobo.
I hope this helps! I will be sharing some of my code, so that you (and/or other people) can try and replicate it!
