Skip to main content
Question

Json attributes with dollar sign


Forum|alt.badge.img

We have some json which contains dollar signs e.g.

{
  "$guid": "2d5f7c9c-8e72-4f23-9538-8e07d4c5dcbc",
  "user": {
    "name": "Alice",
    "$guid": "e891cba7-5565-4c48-a2e1-02cd07f81f54"
  },
  "orders": [
    {
      "$guid": "77e4e751-80e8-470e-92c6-493361a9484f",
      "total": 100.50
    },
    {
      "$guid": "b1263c77-4e5f-4c1e-88e0-6df67ee99f61",
      "total": 250.00
    }
  ]
}

I can’t get the json call step to read the $guid attribute as it just says invaild json path. Is there any work around to this?

Did this topic help you find an answer to your question?

Phil Holbrook
Ataccamer
Forum|alt.badge.img+1

Hi ​@monkmachine 

The $ character is reserved in the json path specification because it refers to the root element. In this sense it is a “special character”

If you need to use special characters in a json path then you need to surround that whole path specification in double-quotes:

I set this up in a json parser (in vn 15.4.1) rather than a json call because obviously I don’t have your online service - but it should work the same.


Forum|alt.badge.img

Thanks ​@Phil Holbrook 

Unfortunately this doesn’t work on version 12.6.3 :(


Phil Holbrook
Ataccamer
Forum|alt.badge.img+1

Ah.  Can’t say I’m surprised, sadly - and that version is a long way out of support.  Are you likely to upgrade in the near future? Full support for all characters inside quotes in json path was implemented in version 15.4.1, although the dollar character may have been supported earlier.

 


Forum|alt.badge.img

​@Phil Holbrook I’ll ask the question but not hopeful. Thank you for taking time to answer. 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings