velistar

New JSON commands

Discussion created by velistar on May 10, 2017
Latest reply on May 10, 2017 by fmpdude

I used FM16's new JSON functions and coupled with the new data viewer window which works wonders. When I tried using a certain API I got some errors, the exact particulars are not necessary. After some debugging I realised that the problem was the JSON created using FM's new JSONSetElement, would actually create the JSON with all the elements in alphabetic order!! This API uses both XML and JSON formats and needs the input from either format in the particular order specified. I think the reason is that XML was used initially which required the format in a certain schema order and then the JSON implementation was adopted based on that.

 

Anyhow this is what I got from FileMaker Pro 16 Help at the very bottom of the page:

Notes
The JSON parser preserves the order of elements in an array, but not the order of elements in an object. Therefore, the JSON functions may return elements in an object in a different order from the order specified.

 

It would be nice if the new commands didn't do any re-ordering!

Outcomes