Forum Discussion

Martin84098's avatar
Martin84098
New Member
3 years ago
Solved

HTML DATA

  Hello, I have the following problem. I would like to prepare the data from the HTML file for further use. I've done it before, but unfortunately I have no idea how to do it. Data see scre...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Martin84098 ,

     

    You deepen the column in this step:

    You can cancel this step and then select the column and parse the text to JSON format.

    Parse text as JSON or XML - Power Query | Microsoft Learn

    All steps:

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wio7JiympjlHKTIlRsjLSATHiCxKLUvNKgPwYJYMYJaBYXmJuKpgbnJmckVqUkZpZUlycnFGakQqWziyOL09NAiswBAvkpEF0G5mCuUXpEK6xcYxSrQ6yhcYYFhqhWWiM3wZjI0wbYvJilWJjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
        #"Parsed JSON" = Table.TransformColumns(#"Changed Type",{},Json.Document),
        #"Expanded Column1" = Table.ExpandListColumn(#"Parsed JSON", "Column1"),
        #"Expanded Column2" = Table.ExpandRecordColumn(#"Expanded Column1", "Column1", {"id", "id_parent", "name", "is_web", "lft", "rgt"}, {"id", "id_parent", "name", "is_web", "lft", "rgt"})
    in
        #"Expanded Column2"

    You can create a new blank query and paste the code into the advanced editor.

     

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum