how to fetch specific value from json

Certified Associate Developer

Hi All , 

I have values stored in database in a particular field i.e. say previousValues, like below 

    • "{"name":"xyz","regDate":"2012-07-01","regStatus":"Completed"}"  --   (Text)

      Now my requirement is to fetch regStatus value from this format . 

      How can I achieve this

        Discussion posts and replies are publicly visible

      Parents
      • 0
        Certified Lead Developer

        You will need to read up on the built-in JSON functions - a!toJson(), and (the one you need) a!fromJson().  Passing your text string through this rule will return a dictionary value, from which you can directly pull the named property by the normal means including just using the dot property (i.e. "local!result.regStatus") or by use of the "property()" function, i.e. "property(local!result, "regStatus", null())".

      Reply
      • 0
        Certified Lead Developer

        You will need to read up on the built-in JSON functions - a!toJson(), and (the one you need) a!fromJson().  Passing your text string through this rule will return a dictionary value, from which you can directly pull the named property by the normal means including just using the dot property (i.e. "local!result.regStatus") or by use of the "property()" function, i.e. "property(local!result, "regStatus", null())".

      Children