Great work @dickoa, congrats! This package help me a lot.
Quick question⦠When importing data using kobo_data(), is there a way to specify that a specific variable should be imported as a character and not numeric? I ask because, in my data, I have a question where I ask my enumerators to report questions not answered by respondents and to separate those numbers by commas (,). So for example, if the respondent did not answer questions 2,3 and 4, the entry for this question would be (2,3,4). However, in the import, kobo_data() interprets this as a numeric question and drops the commas (,) so that in the import, this shows as 234.
Hi @fodhiambo,
Thatās an interesting use case, let me see what can be done. The data is pulled from the API in json format and then parsed into a data.frame in R. Iāll see if during the JSON to data.frame we can allow certain data to be as character.
Iāll need a minimal form to reproduce the behavior to work on a fix. Iāll come back to you ASAP
@dickoa, of course. Let me know how I can be of help on this. I am a new user(just newly registered
) , so cannot upload an xls form. But you can download here >>> xls_form.xlsx - Google Sheets
Can you try the dev version and tell me if it works as expected now ?
# install.packages("pak")
pak::pkg_install("dickoa/robotoolbox")
Donāt forget to restart your session with the new version of robotoolbox.
@dickoa, thanks for this update; the import behaves as expected now. Once again, thank you so much
Thanks @fodhiambo for raising this issue, itāll make the package more robust.
Many thanks for this very useful package.
Are you planning a function to post via API .csv file(s) to the āmediaā folder where Kobotoolbox stores data that is used in the survey form āpulldataā function?
Thanks for considering. Xavier
Thanks Xavier, in the dev version I started working on pull media files. Iāll see if I can add a function to push too. Youāre the second person to ask this feature. Iāll see what I can do and thanks for feedback.
Best,
Ahmadou
Many thanks for this. If you need someone to test the code I will be happy to do so.
With kind regards, Xavier
@dickoa I was wondering if it is possible to delete downloaded attachments from the Kobo server to free up storage?
Hi @guido167
The package was designed to just pull data from the server, not really push/manage.
Itās not the first time I receive this request, Iāll see if itās possible to add a function to delete attachments, subs, etc.
hello @dickoa , for some reasonā¦when i pull data from the server, i noticed that the ā_submission__uuidā is omitted/missing in the repeat groups.
also the forward slash ā/ā is replaced by underscores ā_ā i want this to be replaced by period ā.ā is there a workaround
thanks
Hi @morriz,
Iāll check for the missing submission_uuid in the repeat groups, and fix it if I can reproduce it.
I already provide the option to pick a separator for select multiple questions, Iāll see if I can easily do the same for the group separator too.
Ahmadou
sorry if this has already been asked, but can you point me to where the separator is.? or how its done
Hi @morriz,
This is a separator for the select multiple, not for the group as you want. For the select multiple questions, you have a select_multiple_sep parameter in kobo_data (kobo_submission).
Hi @dickoa after using the kobo_attachment_download function a bit more and basing a lot of my script on it, I notice that somehow it downloads the attachments wrong. When I view my submissions in the table view on the KoboToolbox platform I see which image was uploaded as part of a submission (see top image). When I compare that filename with the image that is in the download folder given in the kobo_attachment_download() it is a completely different imageā¦!
The id added by the kobo_attachment_download() at the start of the filename refers to the correct submission with the correct image.
Could you please check as this messes up our database quite considerably. Thank you! ![]()
@dickoa after rerunning the code again the downloaded image under this filename has changed to another image, but it is still the wrong one. Seems to download random images under the filenames in the submission fields.
Thanks for reporting this issue @guido167, and sorry for the inconvenience. Iāll first try to reproduce this issue and then fix it.
Ahmadou
Thank you @dickoa that would be great. Hope you (or anyone else) can help me with the following: is there a way to generate a link to edit a submission on the Kobo website from R? I am exporting xlsx files and want to have a column that contains a link to edit a record directly (instead of having to look it up in the table). Not sure if this is easy to do?

