jsonGet() won't return string values?

v8.1.38

I'm trying to create an expression tag that ingests specific values from another tag of type "Document". In order to do this, I'm using jsonGet in the expression tag to read values from the document tag. For example:

Config Tag:

{"item":{"firstThing":1,"secondThing":"hello"}}

This seems to work for every json path query except for those that return a string. For instance:

This works:

jsonGet({[.]Config}, "item.firstThing")

However, this doesn't:

jsonGet({[.]Config}, "item.secondThing")

When I try to use the second expression, I get the following error on the tag:

Error_TypeConversion("Error reading document from string: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $")

It seems like jsonGet returns the value correctly, however throws an error because the raw string value is technically a type mismatch? If this is the case, does anyone know how I can set Json Reader leniency if at all?

Thanks

Does your config tag actually have a valid document in it or does it just have a JSON-looking string in it?

8.1.36 seems to work:
image

It has a valid document, it was configured within the tag itself. I only added the string representation that shows as the value in the tag browser.

image

Weird, can't reproduce this in 8.1.43 either.

Thanks for the image!

After the feedback that you and @Kevin.Herron didn't see this issue in other versions, I double checked all the tag settings and noticed that I had fat fingered the data type on the tag. I had it set to document as well by accident, which explains why the tag was throwing the type mismatch error.

Thanks for your help @stevenson and @Kevin.Herron!

3 Likes