- Configuration: FileMaker Pro Advanced 126.96.36.199 - Mac Os Sierra 10.12.6 - iMac 2017
When trying to get the value of a key with the "JSONGetElement()" function placed inside a "JSONFormatElements()" function, this produces an error instead of returning the expected result (see attached file, record 1 = Ok, record 2 = error).
- How to replicate:
• Let's take the JSON code present in the presentation page of the online help and put it in a "json_datas" field (https://fmhelp.filemaker.com/help/16/fmp/en/#page/FMP_Help%2Fjson-functions.html)
• Then, put the following code in a calculation field "json_result":
JSONFormatElements ( JSONGetElement ( json_datas; json_path ) )
• Finally, insert the path into a "json_path" field.
If the path is ".bakery.product", the result into "json_result" field is correct.
If the path is ".bakery.product.name", the result is an error code, whereas it would have been logical to have the value corresponding to the key, "Donuts" in this case.