I am modifying records via API, but I found a specific issue issue with a conditional column, which returns either a Yes, No, or a blank space (“”) depending on the responses in two other columns. For example: I have the “country of origin” column, the “country of residence” column, and the “is the nationality the same as the residence?” column. The answer will change depending on the case.
So, when I send the data via API, the modified data appears in the JSON that the survey API sends. It also shows in the Kobo data table, but when I download the database as an XLSX, it doesn’t download, or when I try to modify the survey, the response isn’t marked.
@Neider_serrano, could you kindly share with the community the entire steps you followed so that we could replicate it at our end to see what is not working?
OK, thank you very much. I will explain my problem in detail and include the steps in Python to make it easier to understand.
The first thing I do is use Python to convert an Excel file into JSON. This Excel file already contains only the columns I want to modify, and it is located in the file named Lugar_origen_vs_ultima_residencia_ns7.xlsx.
These data have already been processed and corrected, and they should be saved exactly as they are in the different surveys. What I mean is that the changes in the Excel file must be reflected as they appear in the XLSX file.
I process this using the script named 1_Convertir_xlsx_json.py, which generates the file datos_corregir.json with the JSON structure required by the server and Kobo’s API.
After this, I use the script 2_Carga_masiva.py, which carries out the necessary process to update the records on the server.
In the script 2_Carga_masiva.py, I call config.json, which contains the connection token for the API, allowing me to interact with the server.
Here is the GitHub link where I have the files I’m using to carry out the process.
Hello, I managed to solve it. It was due to the structure in which Kobo handles its internal JSON, as it assigns prefix letters. It was only showing one without a prefix, and I was only changing that one, Pais_residencia_mismo_origen. C/ to C/Pais_residencia_mismo_origen: “No”, and now it
However, I appreciate if somebody could some kind of guide to understand how the JSON is handled from the Kobo server