I need to return value of json expression

71 views Asked by At

My expression is

 {
    "author": "%{\"id\" => \"f63b6f8a-4e3e-4884-8ce8-21a7885da7a7\", \"name\" => \"Bye\", \"type\" => \"AUTOMATOR\"}"
  }

How do I return AUTOMATOR in the above express?

I am using JSON_EXTRACT(author,"$.type"). Tt is not returning anything

1

There are 1 answers

10
Nikita On

Your json seems to be not valid.

Correct json will be:

 { "author": {"id" :"f63b6f8a-4e3e-4884-8ce8-21a7885da7a7", "name": "Bye", "type" : "AUTOMATOR"} }

you can validate JSONs online, for example at: https://jsonformatter.curiousconcept.com/#