Hi,
I’m kinda new to JSON but really starting to get it’s value for structured textual data.
So I need to create a single record JSON in the below format.
I figure I need to populate an array, perhaps a sub array then converttojson???
Can’t find any clear guidelines to create the logical structure that i’m after.
Any ideas:
I’m not sure if I really got the question. Usually you wouldn’t create it by hand. But if you wanted to you could use a combination of hash tables and arrays … something like this:
I meant if it’s not about some configuration data for a script you wrote yourself the data would probably come from an app, external program or a webservice or an API or something like this.
Neither of those are correctly formatted. Assuming $Person is a hashtable (should be =, not : ) and $FormerGroups is an array (should be a , and not a ; ), then you could do something like this:
Thanks @rob-simmers apologies I’d messed the syntax up accidentally but you got my drift. I just needed a steer how to programmatically create the JSON from array and hash data.
Easy when you know how