Help

Re: Link Kobotools with Airtable

2745 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Claudio_Brenni
6 - Interface Innovator
6 - Interface Innovator

Hi everybody!

I’m new here and learning everyday some new incredible capabilities of Airtable.

I work for a not-for-profit organization and we often use Kobotools to collect data from our beneficiaries. Kobotools is an ODK based survey platform (kobotoolbox.org).

In Kobotools there is a built in REST service and I was trying to connect a an airtable table to Kobo, in order to create a new record with the results of the surveys. But I’ve no expirence with API and I’m really struggling to understand if it is possible to do that and if yes, how I can realize that.

Any help is greatly appreciated :slightly_smiling_face:

Many thanks,
Claudio

12 Replies 12
Claudio_Brenni
6 - Interface Innovator
6 - Interface Innovator

Hi Airtable Community!

I’ve found a solution with Integromat. Thourgh this services is it possible to link kobotools and airtable.

Best Regards,
Claudio

Olena_Panshyna
4 - Data Explorer
4 - Data Explorer

Hi, Claudio.
Could you please tell how did you do that?
I am also working with non profit organization in Ukraine, and this is very actually for us now.

Dear Olena,

I’ve done that through Make (former Intergomat).

  1. You need to open an account in Make: https://www.make.com/en . The first to scenarios are free, so you can try this solution with a couple of forms.

  2. In Make, you start from scratch with a blank scenario. First element you add is a Custom Webhook:
    image

  3. Click on Add on the Pop-up window and copy the webhook address:
    image

  4. Now go to Kobotoolbox and open up the form you want to link. Navigate to SETTINGS:
    image

  5. Then click to REST SERVICE on the left menu and on REGISTER A NEW SERVICE:

  6. On the pop-up that open give the Service a Name and paste the link of the Make Webhook:
    image
    then click on Create

  7. Open the survey in kobotoolbox and answer it, leaving no empty field. That is very important, so that the webhook can determine the data structure of the survey and you can associate it with your airtable base.

  8. Now Make receive the data of the survey that are answered!

  9. It’s time to connect airtable to make. Go back to the Make Scenario maker, click on add another module and search for airtable:
    image
    then click on Airtable and then Click on Create a Record.

  10. You need now to connect make to your airtable base via the API token (more info on how to get it if you don’t know how here). In Make, on the airtable module click on add, give it a name and copy paste the API key form airtable. Then click on SAVE.

  11. If all it is good now you can chose the base and the table you want to link in the menu of the module and the record list will appear:
    image

  12. Now in order to map the kobotoolbox answer to the airtable base you need to run the scenario once:
    image

  13. Open up your kobotoolbox form again and send through another test form with all the answers.

  14. Now go back to make and open up the airtable module, when you click on a record field a list with the fields of the kobotoolbox form answer will appear, chose the variable that need to be associated, to each field:
    image

  15. Once you are done save all and activate your scenario :
    image

  16. Make a test in order to see if all is working correctly :winking_face:

Let me know if you are able to set it up and if you have any other question, I’m glad to help.

Claudio

Olena_Panshyna
4 - Data Explorer
4 - Data Explorer

Thank you, so much, for this detailed tutorial!)
I’ve tried and it works!

Claudio_Brenni
6 - Interface Innovator
6 - Interface Innovator

Dear Olena,

Cool that you could set up the scenario, but not so cool that is not working properly…

In our case I’ll check again the step 14. and look if the association are still there. If not associate all the field again and don’t forget to hit save on the airtable module pop-up. I’ve many time forget to hit save when creating a scenario and all the association were gone.

Another reason could be if you have modified your kobotoolbox form since you have created the scenario. In this case you need to open the webhook module click on the violet button “Redetermine data structure” and then send an answered form. So the webhook will update all the usable field form your form and you can update the mapping of the fields in the airtable module.

Last but not least: are the answer of your form in single choice or multiple choice answer? If yes please be sure that all the possible answer are already existing in airtable, otherwise the airtble will give you an empty field. If this is the case, another solution is to turn on the Smart Link option in the Airtable module, which gives Make the authorization to create new answer choices in single or multiple choice answers.

I hope one of this three suggestion will solve your problem… otherwise don’t hesitate to contact me again.

Best Regards,

Claudio

Hi Claudio - I used your wonderfull screenshots and explanations to make my first connections from Kobo to Make!

I wanted to ask about an error that I am receiving. From one survey in Kobo, three different records are made, which are linked. For example, we are registering a farmer (creating a farmer record), and then creating a garden linked to that farmer (creating a garden record), and then creating species records that are linked to the garden. The Farmers are being registered in a separate base, and then referenced in a different base. When I try to make the second record that is linked to the first, I get this error “You are not permitted to perform this operation because the table “People - Gardens” (tblOgQnKHegAIlPZx) has been configured to limit who can perform this operation” - I think this is because “People-Gardens” table is synced from another base.

image

Any ideas on where I am going wrong?

Hi Katie!

I think you are right with your explanation, as you can read here: Airtable Sync - Basic Setup | Airtable Support

Can I add or delete records in the destination table created by a sync?
Sync is a one-way process so you can not add, edit or delete records in the synced destination table.

Do you I’ve tried to unsync the table and see if you can perform the operation? Or, if you have access, try to add the record directly in the original table in the other base and not in the synced table.

Let me know if these idea were helpful or not :winking_face:

Currently I’m making one record in Base 1, and then a record in Base 2 that has a field that links to the record that is being synced in another table in Base 2 with the records from Base 1. So it’s not adding a new record to the synced table, but rather trying to reference it, like if you were to paste the value directly into airtable and it would automatically link to the record of the same Name.

Not sure if it’s going to work - but I have noticed with the mapping, I can map the second module for creating the second record in airtable to fields from the first one - what is best practice for this?

Hi Katie!

Yes with mapping you can try to add the reference in the table in the Base 2, using the same data from the Kobo form that you use to name the record in the Base 1. It should work, the important bit is that the Data that you use to name your record in Base 1 (the first field) is the same that you use to in the linked field in the Table in Base 2.

Otherwise you can also try to enable the option the Smart Link option in the Airtable module in Make, in order to gain the writing rights. -not sure it would work with a synced Table, but worth to try.

Sergio_Usme
4 - Data Explorer
4 - Data Explorer

Thanks @Claudio_Brenni for this great explaination! I've been looking for this for years! 🤓

I managed to send a couple of test submissions from my project in Kobo to Airtable, not using the API key in step 10, since is going to be deprecated, but the Personal Acces Token - PAT.

I'm currently exploring the right settings in Airtable according to the field type in Kobo, like single-select, multiple-select, attachments, dates, etc, as well as the way to set up "nested" records, like the ones in @Katie_Dowhaniuk 's example. I still have a question though. Maybe you know if it is possible to send not the XML value (yellow, down below) , but the label value (green)?

 

Screenshot 2023-09-16 201339.png

Thanks again.

Sergio

Dear Sergio,

Great that it worked also for you. I also need to change all to the personal Token system, as we are still relying on the API Key. 

For your question, I'm not sure that you can send the label because it all goes through the XML table that is generated by Kobo. As a workaround, you can rename manually the XML value. Be aware that you can't use spaces and special characters here, but you rename it as you want. 

 

Can I polite ask you how did you do with the Personal Token? It would be great if you can explain here what are the changes that are needed, so this tutorial remains up to date. 

Many thanks,

Claudio

 

Sure thing.

This is just for step 10:

10.1 Go to https://airtable.com/create/tokens and select Personal access tokens on the left and then Create new token on the right

10_1.png

10.2 Give your token a Name, select the Scope (https://airtable.com/developers/web/api/scopes) and Access and then click on Create token 

10_2.png

10.3 As soon as you've done a prompt like this will be shown. Be sure of copying the token as it won't be accesible anymore

10_3.png

10.4 Go to Make and set the connection like this

10_4.png

 

Save and and that's it. Everything should work as you described.

 

Note: regardless of the warning in step 10.3 that quotes "Don't share it with third-party services and applications" I needed to provide the whole token into Make. First, I thought that the shortened version in the control panel would work, but Make did not recognize it. The only way I managed to make it work was providing the whole token. 

note.png

I do not fully understand the risks of doing this but it'd be great if someone in the community could give us any insights. 

On the other hand, I will keep searching for a way to send just the labels as XLM tags are kind of "machine" language, not suitable to automate interfaces to a end user. But having this first step done is very promising. There is a light!

Let me know how that PAT works.

Sergio