+2
Under review

Unable to handle data from Json array

Pascal Platteel 6 years ago in Devices / Http updated by Sebastian Salmhofer 5 years ago 3

When using the http driver, I am able to connect to an API and process the Json data. For example:

{

       "id": 60662,

       "country": "NL",

        "main": true

}


But when the data is returned in a Json array, the data cannot be parsed! For example, the folowing respons cannot be handled by Comfortclick:


[

  {

       "id": 60662,

       "country": "NL",

        "main": true

   }

]


or


[

  {

       "id": 60662,

       "country": "NL",

        "main": true

   },

  {

       "id": 906428

       "country": "UK",

        "main": false

   }

]


When will support for Json array's be implemented? A lot of sites are returning Json data within an array nowedays.


Or is there an other workarround to process Json data within an array?

Under review

Hello,


currently, bOS does not quite support these json arrays, however you can try our workaround. Best way for you to test if it works is, to download our Foobot example (in our examples : https://www.comfortclick.com/Software/Examples# ) and see if you can use the same principle in your case.


Best regards.

Hi Pascal,

Use this as an example:

  "DeviceList": [

    {

  "identifier": "5118234654675119",

      "name": "EXAMPLE",

.....

Add a string, for the token name use: DeviceList[0].name

the value you should get is: EXAMPLE

Regards,

Calin

+1

Hi,

are you still planing on implementing support for json arrays? I could use it to.

Sebastian