Forum Discussion

TomTomTom's avatar
TomTomTom
Helper II
6 years ago
Solved

Query CCG JSON url to ShapeMap in PowerBI

Hello, really hope you can help.   I'm stuck trying to get the shapes of CCGs...   https://services1.arcgis.com/ESMARspQHYMw9BZ9/arcgis/rest/services/CCG_APR_2019_EN_NC/FeatureServer/0/query?wher...
  • rainer1's avatar
    6 years ago

    Hi,

     

    here is a Power Query for you who hopefully will solve your problem. 

    let
        Source = Json.Document(Web.Contents("https://services1.arcgis.com/ESMARspQHYMw9BZ9/arcgis/rest/services/CCG_APR_2019_EN_NC/FeatureServer/0/query?where=1%3D1&outFields=*&outSR=4326&f=json")),
        features = Source[features],
        #"convertedtoTable" = Table.FromList(features, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
        #"expandedColumn" = Table.ExpandRecordColumn(#"convertedtoTable", "Column1", {"attributes"}, {"Column1.attributes"}),
        #"expandedAttributes" = Table.ExpandRecordColumn(#"expandedColumn", "Column1.attributes", {"CCG19CD", "CCG19CDH", "CCG19NM", "FID"}, {"Column1.attributes.CCG19CD", "Column1.attributes.CCG19CDH", "Column1.attributes.CCG19NM", "Column1.attributes.FID"})
    in
        #"expandedAttributes"

     I think you only need the arrtibutes ?

     

    I leave the column names unformatted but you can rename as you like.

     

    The Output will look like this.

     

     

    -------------------------------------------------------------------
    Did I answer your question? Mark my post as a solution!
    It was useful? Press Thumbs Up!