AnsweredAssumed Answered

It's impossible to use a literal dot in a JSON key with FileMaker's JSON parsing functions

Question asked by jbarnum on Oct 22, 2017
Latest reply on Nov 27, 2018 by TSGal

I am trying to access a REST web service where the keys have dots in the name. FileMaker interprets a dot in a key name to indicate a sub-element. Is there any way to escape the dot so that FileMaker treats it literally instead of as a separator?

 

For instance, if I have JSON like this:

 

{

     "value1": "Red",

     "value_1": "Green",

     "value.1": "Blue"

}

 

this works: JSONGetElement ( $json ; "value1" )

this works: JSONGetElement ( $json ; "value_1" )

this fails (returns an empty value): JSONGetElement ( $json ; "value.1" )

this also fails (returns an empty value): JSONGetElement ( $json ; "value\.1" )

this also fails (expects an array reference): JSONGetElement ( $json ; "['value.1']" )

 

I've seen escape syntaxes in other parsers that use the last format ( [' '] markers as literal text ), but that doesn't seem to work in FileMaker.

Outcomes