New Layout: Using API, fields are retrieved in different order

  • Profile Image
    Asked on January 03, 2018 at 05:38 AM

    using this API

    GET / form / {id} / questions

    the JSON structure of the answers does not respect the order in which they were constructed and displayed online.

    I Created

    1) Name and Surname

    2) Email

    I get

    1) Name and Surname

    2) Address

    The link of the form:

    the JSON answer
        "id": "3907248464889084633",
        "form_id": "72691676319367",
        "ip": "",
        "created_at": "2018-01-02 12:54:07",
        "status": "ACTIVE",
        "new": "0",
        "flag": "0",
        "updated_at": "2018-01-02 12:54:30",
        "answers": {
          "2": {
            "name": "datiGenitoreINPS",
            "text": "Dati genitore",
            "type": "control_fullname",
            "answer": {
              "first": "MARIO",
              "last": "ROSSI"
            "prettyFormat": "MARIO ROSSI"
          "3": {
            "name": "indirizzoGenitoreINPS",
            "text": "Indirizzo",
            "type": "control_address",
            "answer": {
              "addr_line1": "Via Milano, 51",
              "addr_line2": "",
              "city": "ROMA",
              "state": "",
              "postal": "00100",
              "country": ""
            "prettyFormat": "Indirizzo: Via Milano, 51<br>Città: ROMA<br>Codice Postale: 00100<br>"

  • Profile Image
    Answered on January 03, 2018 at 07:12 AM

    Can you please give us more information.

    Did you make any recent changes on your form? Also what Library are you using?

  • Profile Image
    Answered on January 03, 2018 at 09:16 AM

    Hi Adrian

    I realized the form and then I have added other controls.

    I invoke the API using c#.

    The problem is that the number of the items in the Json parts "answers" is not the same of what is displayed on line.

  • Profile Image
    Answered on January 03, 2018 at 11:07 AM

    I have been testing this and I can see what you're reporting, but the thing seems to be related to the fields of the form, I will forward it to our second level so this can be checked, as far as I know the fields should appear in the same order on both ends, the API calls as well as the builder. 

    We will keep you updated via this thread. 

  • Profile Image
    Answered on January 07, 2018 at 12:32 AM

    Form questions returned via the API are ordered chronologically, i.e., by the time each question was added to the form.

    To get the correct order by which the questions are displayed on the form, simply refer to the "order" property of the question object.


    Hope this answers your question.


  • Profile Image
    Answered on January 07, 2018 at 12:42 AM

    As for submissions, you can always refer to the QID property (the index of the answers object) and rearrange it programatically.