19Jun, 2017
6Comments

How To Update An External List Using Kizeo Forms’ API?

 

This article is intended for advanced Kizeo Forms users and the instructions given here require IT skills.

Using external lists inside your forms is very convenient. It allows you for instance to insert useful informations like customers contact details, lists of supplies or lists of references. You can re-use those same lists in different forms. Did you know that there is a way to automatically update all those lists? Meaning that when you make a change in the original list, it will be effective in the all the forms where you used this list. In order to do that, you need to use our API. Let’s see exactly how to proceed.

1. Make the inventory of all your external lists.

First of all, you need to retrieve the summary of all your external lists by using a GET request to the following URL: https://www.kizeoforms.com/lists/.

This first step will allow you to get an “id” of each one of your external lists linked to its name. This “id” will be necessary to continue.

You will retrieve the data doing as follows:

[
    {
        "id1": "Number_list_1",
        "name1": "Name_list_1"
    },
    {
        "id2": "Number_list_2",
        "name2": "Name_list_2"
    },
    {
        "id3": "Number_list_3",
        "name3": "Name_list_3"
    }
]

2. Retrieve all the items of your external lists.

The second step will be to retrieve the external list you want to update by using the “id” obtained when doing the GET request.

N.B.: To update them all, you need to do that for each one of your lists.

In order to have a full definition of it, without applying any filter when selecting its items, you need to send a GET request to the following URL: https://www.kizeoforms.com/lists/{listId}/complete. 

Be careful! When you send it, do not forget to insert your id token at the top of your request.

You should replace {listId} by the id of the list you want to update.

You will then receive your list under the following JSON format:

{
    "id": "integer",
    "name": "string",
    "items": [
        "Item1",
        "Item2",
        "Item3"
    ]
}

The “id” being the identifier of the list you asked for,  “name” being the name of this list and “items” being the table containing all the items as a string.

Just add to this list the items that you want to insert in your external list. Then, send once again a PUT request to the following URL: https://www.kizeoforms.com/lists/{listId}

Then add the list you just modified (will the old and new items) inside your request. You do not need to mention its id or name again.

For instance:

{
    "items": [
        "Item1",
        "Item2",
        "Item3",
        "New_item1",
        "New_item2"
    ]
}

Be careful: If you only send the new items in your PUT request, the old items will be deleted!

Feel free to comment this article!
We would be glad to hear any question, comment or suggestion you may have !


There Are 6 Comments

  • DIFRECTOR

    20 Nov, 2020

    Is it possible for yourselves to set up the required API connection etc. to our database?

    • Kurt Carpels

      23 Nov, 2020

      Hi Shaun,

      Please have a look at the documentation related to this topic, by clicking here.

      Should you have further questions, please feel free to get in touch with our Support team: support@kizeo.com

      Have a nice day.

      Kurt

  • ROHAN

    03 Oct, 2020

    HI KURT,

    IN CASE I NEED TO USE API, WHICH I SUPPOSE I WOULD NEED, WOULD IT BE POSSIBLE FOR KIZEO TO HELP ME OUT TO TEACH IN DETAIL?

    • Kurt Carpels

      05 Oct, 2020

      Dear Rohan,

      Once you will make your request at the support team, we will provide you the documentation.

      Have a nice day.

      Kurt

  • Rohan Dinesh Kotecha

    13 Sep, 2020

    Do i require basic programming knowledge the design my forms, connect my existing data to these forms for Dropbox options & then get a report which has formula based fields?

    • Kurt Carpels

      15 Sep, 2020

      Dear Rohan,

      You don’t need specific programming skills for creating forms, Dropbox or export data.
      Programming skills are required if you use our API.

      Have a nice day!

      Kurt

Post a comment

Your email address will not be published. Required fields are marked *