Share
Explore

icon picker
Generate Schema

Prabhjot Singh Lamba

Standalone Formula Example

Input:
'{"name": "Prabhjot", "skills": ["Programming", "Marketing", "Designer", "3D Artist"]}'
Output:
coda.makeObjectSchema({properties: { name: { type: coda.ValueType.String }, skills: { type: coda.ValueType.Array, items: {type: coda.ValueType.String} }}})

Table Formula Example

NOTE:
Create the json structure in and copy value from there in the Json Value column
You can copy schema code value and paste into your own packs
Coda Columns Quotation “” gives an error on calling JSON.parse() so writing JSON directly in Json Value column won’t work.
Get Schema Code
0
Json Value
Schema Coda
1
{"a": [{"b": 2, "c": [1,2,4]}]}
coda.makeObjectSchema({properties: { a: { type: coda.ValueType.Array, items: {type: coda.ValueType.Object,properties: { b: { type: coda.ValueType.Number }, c: { type: coda.ValueType.Array, items: {type: coda.ValueType.Number} }}} }}})
2
[3, 6, 7]
coda.makeSchema({type: coda.ValueType.Array, items: {type: coda.ValueType.Number}})
3
{"name": "Prabhjot"}
coda.makeObjectSchema({properties: { name: { type: coda.ValueType.String }, }})
4
{ "array": [ 1, 2, 3 ], "boolean": true, "color": "gold", "null": null, "number": 123, "object": { "a": "b", "c": "d" }, "string": "Hello World" }
coda.makeObjectSchema({properties: { array: { type: coda.ValueType.Array, items: {type: coda.ValueType.Number} }boolean: { type: coda.ValueType.Boolean }, color: { type: coda.ValueType.String }, number: { type: coda.ValueType.Number }, object: { type: coda.ValueType.Object, properties: { a: { type: coda.ValueType.String }, c: { type: coda.ValueType.String }, } }string: { type: coda.ValueType.String }, }})
There are no rows in this table

Bonus Formula: Get Data Type of any Json object

Get Data Type
0
Json Value
Data Type
1
2
number
2
"Prabhjot"
text
3
[1,2,3]
list
4
{"name": "Prabhjot"}
json
5
true
yes/no
6
null
empty
There are no rows in this table

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.