Skip to content

Commit e96ef2b

Browse files
authored
Update 2024-06-25 - import a list of json files.pq
1 parent 94e1d00 commit e96ef2b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

forumQuestions/pq/2024-06-25 - import a list of json files.pq

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,15 @@ let
2828
(row) => [
2929
// I threw in extra record fields to make errors easier to read
3030
// you only need the field "Table"
31-
JsonList = Json.Document( row[Content] ),
31+
JsonList = Json.Document( row[Content] ),
3232
Table = Table.FromRecords( JsonList ),
3333
HasError = (try Table)[HasError]
3434
],
3535
type [ JsonList = list, Table = Table.Type, HasError = logical ]
3636
),
37+
// if you want json to be a table, it expects it to be an array (aka list) at
38+
// the top level. if yours is not, you'll need to either shape it, or drill down into an array.
39+
3740
#"Expanded Json" = Table.ExpandRecordColumn(Column_ConvertJson,
3841
"Json",
3942
{"Table", "HasError" },

0 commit comments

Comments
 (0)