Select JSON records as Excel table via Power Query

Blue1971

New Member
Joined
May 19, 2020
Messages
15
Office Version
  1. 2016
Platform
  1. Windows
I have a URL that points to a sample server that returns JSON records:
https://sampleserver6.arcgisonline....pServer/0/query?where=1=1&outFields=*&f=pjson

I want to use the JSON records in Excel 2016 as a table.

I've attempted to do this by connecting to the URL via Excel Power Query:

enter image description here

However, it seems like Power Query is treating the data as CSV records, not as JSON records.

enter image description here

So the data is not coming into Power Query as a proper table.

enter image description here

How can I get Power Query to select the JSON records as a table in Excel?

Thank you.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Delete second step, Changed Type, then select Source and change the function with the following:

VBA Code:
= Json.Document(Web.Contents("https://sampleserver6.arcgisonline.com/arcgis/rest/services/LocalGovernment/Events/MapServer/0/query?where=1%3D1&outFields=*&f=pjson"))

Or open Advanced Editor, delete everything and paste the following:
VBA Code:
let
    Source = Json.Document(Web.Contents("https://sampleserver6.arcgisonline.com/arcgis/rest/services/LocalGovernment/Events/MapServer/0/query?where=1%3D1&outFields=*&f=pjson"))
in
    Source

You'll get the following:

1594872108527.png


I think you can continue from here by knowing which data you need, but keep posting if you need more help - also explaining which data / how you need to transform the source data. There are many Power Query experts in MrExcel Message Board who'd try to help.
 
Upvote 0
Delete second step, Changed Type, then select Source and change the function with the following:

VBA Code:
= Json.Document(Web.Contents("https://sampleserver6.arcgisonline.com/arcgis/rest/services/LocalGovernment/Events/MapServer/0/query?where=1%3D1&outFields=*&f=pjson"))

Or open Advanced Editor, delete everything and paste the following:
VBA Code:
let
    Source = Json.Document(Web.Contents("https://sampleserver6.arcgisonline.com/arcgis/rest/services/LocalGovernment/Events/MapServer/0/query?where=1%3D1&outFields=*&f=pjson"))
in
    Source

You'll get the following:

View attachment 18311

I think you can continue from here by knowing which data you need, but keep posting if you need more help - also explaining which data / how you need to transform the source data. There are many Power Query experts in MrExcel Message Board who'd try to help.


Thanks. That helped me retrieve my data.

-Ben
 
Upvote 0

Forum statistics

Threads
1,214,516
Messages
6,119,981
Members
448,934
Latest member
audette89

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top