How to Get web data based on link in excel cell? - excel

I'd like to create an Excel sheet, where in one column there is a link to a website
like this:
Link in column A where there is a MAC add in that url that changes from line to line rest of link is geraric. and it takes the info in the 2 lines marked with arrows and put into another cell.
This should be possible for multiple links in different rows from websites with the same structure.
How can I make the web query to be based on the link in the adjacent cell?

You can use Power Query to read the contents of a cell.
Then in Power Query, you can return the web contents of the URL like this:
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Get Web Contents" = Xml.Tables(Web.Contents(Table.FirstValue(Source))),
in
#"Get Web Contents"
You will need to be mindful of the data your query returns, i.e. is it a single value, table, or otherwise?
Here is documentation on how to to load the results from Power Query back to your excel worksheet: https://support.microsoft.com/en-us/office/create-load-or-edit-a-query-in-excel-power-query-ca69e0f0-3db1-4493-900c-6279bef08df4

I sort of found out. just made a simple WEBSERVICE(A2) to the URL and it returns a string with all the data, now i just need to extract only the data i need.

Related

How do I change a column name of a table in Confluence using alasql

I have multiple pages in Confluence, each with the same table with different content.
I want to collect all these tables into one table. This works.
Now I want to add the name of the pages into the first column. This works.
But, this column is called pages. I want it to be called Projects.
The underlying table might be expanded and therefore I do not know which nor how many columns the tables have. That is the reason why I use T1.*. I need all that columns that are there, but I want to leave out the Page column.
I am using the Table Transform, which enables me to write a SQL script.
The SQL syntax is ALASQl.
I tried the following, which gives another column called Projekt:
SELECT T1.'Page'AS Projekt, T1.* FROM T
But how do I remove column Page?
There is no rename in asasql in confluence.

How to search a website using a range of cells in excel to extract specific data

I'm trying to search the website "capfriendly.com/players/" using a column of cells and import the "Cap Hit" value back into excel in the adjacent column for each.
I'm a complete beginner when it comes to programming, so I've mostly been trying to learn from previous questions such as this one: excel macro to search a website and extract results
I'm still pretty perplexed, especially with how to extract just the specific value I'm looking for. Any guidance would be greatly appreciated.
I don't know which version of Excel you work with.
Anyway you can try this :
Create a new sheet.
Go to Data in the ribbon to get external data and choose "From web".
Input the url of your page ie https://www.capfriendly.com/browse
After a moment you should retrieve "Results" data that you can load with or without structure modifications. You now have a data table in your new sheet.
You can now access it with Vlookup or similar function, with VBA code or with formulas, to put specific data on specific cells of specific sheets like you need to.
Hope it helps.

Excel 365 Get Data from web-based Json API issue

I am trying to Get & Transform data from a web API.
When I go to the URL through a browser I can view the data.
I copy the URL. Open Excel 365, click get data ...from web and paste the URL.
It looks like Excel is recognizing that it is a Json, because power query has Json.Document.....
However, it is not letting me view the actual data, each line only has "Record"
When I try Close & Load it loads [Record] into the rows in column A.
Any ideas on what is going on?
Kind Regards,
Dom
That's typically how data gets loaded in Power Query. Record's or Lists can be expanded to get the data inside them.
There are 2 things that you will want to based on what you want.
Click on any one record to see the data in just that one Record
Click on the Expand button on the column header to see data of all the Records in their respective rows. Please check out this answer
If you're not able to figure it out, please post an image.

How to dynamically retrieve data from web to excel using Power Query

I have never used Power Query before so I'm not sure if what I'm asking is even possible. I want to find out a way in excel to dynamically import data from a website based on the value given in another cell, something like importhtml in google sheets. For example, here's what I created using google sheets:
If you notice,
the first column is an NPI number which is what I'd provide (copy and paste to the column in excel).
the second column is the url from where the data to is to be downloaded. The url number value is referenced to column A.
importHTML then imports the data and puts them in the column following URL.
So, is it possible to do something like this using Excel Power Query?
Although I used the regular url to pull down the data in html table format, I prefer to use JSON if possible. The only reason I didn't use JSON in google sheets is because I don't know how to. The URL for NPI lookup API is https://npiregistry.cms.hhs.gov/api?number= where we can enter any NPI number to lookup.
Yes, Power Query's Web.Contents function has a parameter for the URL - this can be an expression or a literal, or a concatenation of both. You can get a jump start on the syntax by using the "From Web" button (in Excel 2016+, this is (sadly) a bit buried under Data / New Query / From Other Sources) - this will generate the code including the Web.Contents function with a literal URL. Power Query will also look at the contents returned and wrap the appropriate function around Web.Contents e.g. Json.Document.
You could start from your existing Google Sheets file (they are also easy to consume using Get Data / From Web), and use Add Custom Column to paste in your Web.Contents code. You can insert a column reference to make the URL dynamic - using & for string concatenation.

Refreshable Web Query using Excel 2010 and Parameters

I'm looking to pull into the XML feed from Feedburner's API. This is just a matter of writing the URL and using the "From Web" data connection in Excel.
https://feedburner.google.com/api/awareness/1.0/GetItemData?uri=RSSFEEDNAME&dates=2011-08-01,2011-08-05
This works fine (and is pretty fast).
Now, I'd like to be able to update two cells in the "dates" sheet to have it pull that range of data. This is done using parameters in the URL:
https://feedburner.google.com/api/awareness/1.0/GetItemData?uri=RSSFEEDNAME[]
Using the Excel UI, I can then assign the [] to any cell. However, no matter what I try, this doesn't work. I initially thought there might be some issue with the date format so I've worked myself to the point where I am entering into the cell, the exact copy (&dates=2011-08-01,2011-08-05) as text.
Each time, the feed pulls up with just the current days data (which is the default behavior when no dates are specified). It isn't giving an error (which it will do for relatively small infractions, like not having two-digit months) which makes me think it just simply isn't replacing the [] with the specified text. I'm also using this same method for a WebTrends Web Service query and gettign similarly frustrating results. I've read every how-to on web queries, and I'm following them exactly.
I can't find any place to see what the final URL Excel is requesting, so it's a bit of a shot in the dark. Any thoughts on next steps would be greatly appreciated!
Best,
Nathan
The answer was no to use the Web Query "wizard" and just do it by hand.
Open Notepad (or some text editor)
In the editor type the following four lines:
WEB
1
http://example.com/index.html?something=[]&somethingelse=[]
[BLANK]
Save it as anything with an .iqy extension.
Open Excel, go to the Data ribbon, and click "Existing Connections"
Click "Browse for More..."
Find the IQY file you made and click "Open"
Excel will then ask you where you want to put the resulting data, followed by prompts for each placeholder you entered in the URL. Those prompts let you either type in a value, or select a cell to act as the data.
I would have thought that dates should have been a named parameter and that you should link that to whichever cell has the date value(s).
The cell should just have 2011-08-01,2011-08-05 as its value as long as you create the named parameter dates and link it to that cell

Resources