I am struggling to extract the data from my JSON source (see below)
My goal is to have the headings:
I have managed to extract the last three headings by luck more than anything using the following:
If anyone has any relevant tutorials or help it would be much appreciated.
I have tried a number of searches but I just cant get it to work.
Thanks you,
Code:
[COLOR=#000000][FONT=Consolas][{"id":"TEST1","created_at":"2017-02-22 11:55:15 +0000","updated_at":"2017-02-22 12:09:56 +0000","created_by":"chris.k@b.com","fields":[{"id[/FONT][/COLOR]<wbr style="color: rgb(0, 0, 0); font-family: Consolas, "Courier New", monospace; font-size: 12px; box-sizing: inherit;">[COLOR=#000000][FONT=Consolas]":"f--description","name":"Description","display_t[/FONT][/COLOR]<wbr style="color: rgb(0, 0, 0); font-family: Consolas, "Courier New", monospace; font-size: 12px; box-sizing: inherit;">[COLOR=#000000][FONT=Consolas]ype":"textarea","value":"Paint"},{"id":"f--date","[/FONT][/COLOR]<wbr style="color: rgb(0, 0, 0); font-family: Consolas, "Courier New", monospace; font-size: 12px; box-sizing: inherit;">[COLOR=#000000][FONT=Consolas]name":"Date","display_type":"date","value":"2017-0[/FONT][/COLOR]<wbr style="color: rgb(0, 0, 0); font-family: Consolas, "Courier New", monospace; font-size: 12px; box-sizing: inherit;">[COLOR=#000000][FONT=Consolas]3-31"},{"id":"f--location_id","name":"Location","d[/FONT][/COLOR]<wbr style="color: rgb(0, 0, 0); font-family: Consolas, "Courier New", monospace; font-size: 12px; box-sizing: inherit;">[COLOR=#000000][FONT=Consolas]isplay_type":"location","value":"da206e01"}],"comm[/FONT][/COLOR]<wbr style="color: rgb(0, 0, 0); font-family: Consolas, "Courier New", monospace; font-size: 12px; box-sizing: inherit;">[COLOR=#000000][FONT=Consolas]ents":[],"attachments":[]},{"id":"TEST2","created_[/FONT][/COLOR]<wbr style="color: rgb(0, 0, 0); font-family: Consolas, "Courier New", monospace; font-size: 12px; box-sizing: inherit;">[COLOR=#000000][FONT=Consolas]at":"2017-02-22 11:55:55 +0000","updated_at":"2017-02-22 12:09:56 +0000","created_by":"chris.k@b.com","fields":[{"id[/FONT][/COLOR]<wbr style="color: rgb(0, 0, 0); font-family: Consolas, "Courier New", monospace; font-size: 12px; box-sizing: inherit;">[COLOR=#000000][FONT=Consolas]":"f--description","name":"Description","display_t[/FONT][/COLOR]<wbr style="color: rgb(0, 0, 0); font-family: Consolas, "Courier New", monospace; font-size: 12px; box-sizing: inherit;">[COLOR=#000000][FONT=Consolas]ype":"textarea","value":"Dogs"},{"id":"f--date","n[/FONT][/COLOR]<wbr style="color: rgb(0, 0, 0); font-family: Consolas, "Courier New", monospace; font-size: 12px; box-sizing: inherit;">[COLOR=#000000][FONT=Consolas]ame":"Date","display_type":"date","value":"2017-03[/FONT][/COLOR]<wbr style="color: rgb(0, 0, 0); font-family: Consolas, "Courier New", monospace; font-size: 12px; box-sizing: inherit;">[COLOR=#000000][FONT=Consolas]-31"},{"id":"f--location_id","name":"Location","di[/FONT][/COLOR]<wbr style="color: rgb(0, 0, 0); font-family: Consolas, "Courier New", monospace; font-size: 12px; box-sizing: inherit;">[COLOR=#000000][FONT=Consolas]splay_type":"location","value":"da206e01"}],"comme[/FONT][/COLOR]<wbr style="color: rgb(0, 0, 0); font-family: Consolas, "Courier New", monospace; font-size: 12px; box-sizing: inherit;">[COLOR=#000000][FONT=Consolas]nts":[],"attachments":[]}][/FONT][/COLOR]
My goal is to have the headings:
Code:
[COLOR=#000000][FONT=Consolas]id | created_at | created_by | f--description | f--date | f--location_id[/FONT][/COLOR]
I have managed to extract the last three headings by luck more than anything using the following:
Code:
let Source = Json.Document(File.Contents("C:\Users\Chris.Kemp\Desktop\test.json")),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"id", "created_at", "updated_at", "created_by", "fields"}, {"Column1.id", "Column1.created_at", "Column1.updated_at", "Column1.created_by", "Column1.fields"}),
#"Column1 fields" = #"Expanded Column1"{0}[Column1.fields],
#"Converted to Table1" = Table.FromList(#"Column1 fields", Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column2" = Table.ExpandRecordColumn(#"Converted to Table1", "Column1", {"id"}, {"Column1.id"}),
#"Transposed Table" = Table.Transpose(#"Expanded Column2")
in
#"Transposed Table"
If anyone has any relevant tutorials or help it would be much appreciated.
I have tried a number of searches but I just cant get it to work.
Thanks you,