0

I'm trying to load my Firebase data to Power BI, the data is a JSON map of the following format

{
    "soh4gf1k": {
        "name": "bill",
        "age": "40",
        "maritalStatus": "married"
    },
    "itnhwagx": {
        "name": "jane",
        "age": "28",
        "maritalStatus": "single"
    }
    ...
}

I tried to follow the instructions in Loading a json file into Power Query but in that case the data was in array form, and i can't seem to get it right for my case.

let
    Source = Json.Document(Web.Contents("url to firebase database")),
    #"Converted to Table" = Record.ToTable(Source),
    #"Expanded Value" = Table.ExpandListColumn(#"Converted to Table", "Value"),
    #"Expanded Value1" = Table.ExpandRecordColumn(#"Expanded Value", "Value", {"name", "age", "maritalStatus"})
in
    #"Expanded Value1"

throws the following error:

Expression.Error: We cannot convert a value of type Record to type Table. Details: Value=Record Type=Type

1 Answer 1

0

I started from scratch using the Power Query UI editor against your sample data, and got a script that has the same first 3 lines, then:

    #"Expanded Value" = Table.ExpandRecordColumn(#"Converted to Table", "Value", {"age", "maritalStatus", "name"}, {"age", "maritalStatus", "name"})
in
    #"Expanded Value"

The "Converted to Table" step results in an object name column (containing values "soh4gf1k", "itnhwagx") named: [Name]. You'd probably want to rename that to avoid confusion with the lower-level [name] column.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .