Hi All ,
I have values stored in database in a particular field i.e. say previousValues, like below
Now my requirement is to fetch regStatus value from this format .
How can I achieve this
Discussion posts and replies are publicly visible
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())".
Hi Mike,
I received this below error
The value parameter must be a CDT, a dictionary, a map, a record, or a list. Received type: [Text],
Please share a code snippet for what you're trying. It works right away when I try it.
Hi Mike
"{"name":"PQ","cStartDate":"2012-07-01Z","eTerm":"2028-06-30Z","sStatus":"NA","t":1110.0,"Months":12,"Name":"","Text":"Eng","siteAccessConditionsIfApplicable":"rDo not use \n++++++++++++++++++++++++++++++++++++++++\n\n\n","cMer":"GFTA"}"
this is the one of the value at index one
Works just fine...
did you put this value as it is or you have removed something from this
as-is, minus the outermost quotes which aren't part of the valid JSON string.
Once again, you haven't really clarified what code you're actually trying to run on the value you're getting, so I can't really guess at what might be going wrong. Please post a code snippet or something.
Hi Mike ,
say I fetching data from database , which returns list of 3 text strings
I want to iterate this ,
but when I use ,
a!forEach(items: ri!valueToConvert,expression: a!fromJson(fv!item))
I received this Error :