Sometimes we may store JSON as text in a list column. Maybe something like this in a column called PerformanceMetrics:
``` json
{
"competency": "Auto Painting",
"subCompetency": "Dent Repair",
"last12Months": {22, 305, 10, 305, 123, 895, 234, 684, 203, 102, 302, 292}
}
```
To enable better conversion of the text value to JSON in applications, add a new mapping option using objectType: "JSON". By using $.parseJSON, we can convert from the text representation to JavaScript objects.
The conversion function looks like this:
``` javascript
function jsonToJsonObject(s) {
if (s.length === 0) {
return null;
} else {
return $.parseJSON(s);
}
}
```
``` json
{
"competency": "Auto Painting",
"subCompetency": "Dent Repair",
"last12Months": {22, 305, 10, 305, 123, 895, 234, 684, 203, 102, 302, 292}
}
```
To enable better conversion of the text value to JSON in applications, add a new mapping option using objectType: "JSON". By using $.parseJSON, we can convert from the text representation to JavaScript objects.
The conversion function looks like this:
``` javascript
function jsonToJsonObject(s) {
if (s.length === 0) {
return null;
} else {
return $.parseJSON(s);
}
}
```