Prompt Title: HTTP data to Excel

Created 11 months ago
Votes 0
Views 141 times
IT
0
Human: is it possible to put content from multiple http requests into single excel table using power query?
ChatGPT:

Yes, it is possible to put content from multiple HTTP requests into a single Excel table using Power Query. Here are the steps you can follow:

  1. Open a new Excel workbook and navigate to the "Data" tab.
  2. Click on "Get Data" and select "From Other Sources" > "Blank Query".
  3. In the Power Query Editor, click on "Home" > "Advanced Editor".
  4. In the Advanced Editor, enter the following code:
csharp
let Source1 = Web.Contents("http://example.com/api/data1"), Source2 = Web.Contents("http://example.com/api/data2"), Content1 = Json.Document(Source1), Content2 = Json.Document(Source2), Table1 = Table.FromList(Content1, Splitter.SplitByNothing(), null, null, ExtraValues.Error), Table2 = Table.FromList(Content2, Splitter.SplitByNothing(), null, null, ExtraValues.Error), CombineTables = Table.Combine({Table1, Table2}) in CombineTables
  1. Replace the URLs in the code with the URLs for the HTTP requests you want to combine.
  2. Click "Done" and the data from the HTTP requests will be loaded into a single table in Excel.

Note that the above code assumes that the content from the HTTP requests is in JSON format. If the content is in a different format, you may need to modify the code accordingly.

avatar
Excel
Shared 1 prompt
Created 11 months ago

Leave a Comment

Related Tag Prompts

336
0
Excel Expert
1 year ago 2023-01-22 21:26:36 AIPRM