Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to format this json
    primarykey
    data
    text
    <p>I'm writing some JSON for a temporary table view on a website. Never written JSON before so would really appreciate some help.</p> <p>I need to show lists of crew members split into sets of 18 per year which are then split into 2 sets of 9 ech with 4 properties.</p> <p>The hierarchy would look something like this:</p> <ul> <li>2013 <ul> <li>Result</li> <li>Blue boat <ul> <li>position, name, college, weight</li> <li>(+8 more)</li> </ul></li> <li>Isis (reserve boat)</li> </ul></li> <li>2012</li> <li>2011</li> <li>(...since 1829)</li> </ul> <p>This is my first attempt at writing/formatting JSON so please only comment if you're being helpful or constructive.</p> <p><strong>JSON</strong></p> <pre><code>{ "crews": [{ "items": [ { "year" : "2013", "boat" : "Blue", "position" : "1", "name" : "Patrick Close", "college" : "Pembroke", "weight" : "14st 2lbs" }, { "year" : "2013", "boat" : "Blue", "position" : "2", "name" : "Geordie Macleod", "college" : "Christ Church", "weight" : "13st 10lbs" }, { "year" : "2013", "boat" : "Isis", "position" : "1", "name" : "Iain Mandale", "college" : "Mansfield", "weight" : "11st 11lbs" }, { "year" : "2013", "boat" : "Isis", "position" : "2", "name" : "Nichola Hazell", "college" : "Christ Church", "weight" : "14st 9lbs" }] } } </code></pre> <p><strong>Is this better?</strong></p> <pre><code>{ "crews": [ { "year": [ { "2013": [ { "boat": [ { "Blue": [ { "boat" : "Blue", "position" : "1", "name" : "Patrick Close", "college" : "Pembroke", "weight" : "14st 2lbs" }, { "boat" : "Blue", "position" : "2", "name" : "Geordie Macleod", "college" : "Christ Church", "weight" : "13st 10lbs" } ], "Isis": [ { "boat" : "Isis", "position" : "1", "name" : "Iain Mandale", "college" : "Mansfield", "weight" : "11st 11lbs" }, { "year" : "2013", "boat" : "Isis", "position" : "2", "name" : "Nichola Hazell", "college" : "Christ Church", "weight" : "14st 9lbs" } ] } ] } ] } ] } ] } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload