KoboToolBox API -> Update an existing form with additional choices

Hi all,

I would like to know if there is an update functionality in the API to update my existing survey/form.

In my application an user can create a form with choices based on our database. It is required to update the form with the latest choices.

The reason is I have created my form via the api and tried to deploy it, however it was missing a list_name, and I would like to update my survey to deploy it. And even after deploying it, I would like to update my choices sheet with the latest data.

I truly hope someone can help me forward because I’m currently stuck and I really need the update functionality.

Kind Regards

1 Like

@allgovmatters, have you gone through our support article Dynamic Data Attachment? It should help you solve your issue:

Thanks @Kal_Lam , I did not have gone through it before but now I have.

Is this the only way to add additional choices or update existing choices? Seems to me a bit too much. I also would like to do it via the API because everything is done via our software. We do not want to have users use the kobotoolbox environment themselves but via our application.

Currently we have the following functionality working:

  • Create new project with survey
  • Deploy functionality

But choices can be changed over time, lets say we have a list of names of people. And in our software a new person is added, we would like to add that name to the list of names.

Creating a parent-child project seems a bit too much for a simple update of choices. The API documentation is very limited and I could not find anything about Dynamic Data Attachments.

@Kal_Lam Could you or one of the other team members please reply to my question?

Maybe you could use the pull-data function and use an external CSV file (which you will have to update and upload manually). If you wish to use an API to upload the same manually, you could do it as discussed previously:

Look at the API call when you edit a form using the online editor.
Didn’t try yet but the request below should allow you to do so:
PATCH <SERVER_URL>/api/v2/assets/<YOUR_ID>/

Note that you have to put the whole survey in the body that you can get using the following endpoint:
GET <SERVER_URL>/api/v2/assets/<YOUR_ID>/