I would like to get Google Sheet's URL automatically when there is a specific no. in row A and a sheet name provided as prerequisites.
If there is 15106 in row A and a sheet name --> See this
I would like to display it somewhere on the same line with the number.
You can try writing an onEdit() function that gets the URL when the sheet is edited - you can tell the function to look for specific ranges and values as you desire. You will have to assemble the url yourself using spreadsheet ID, which you can get using SpreadsheetApp.getActiveSpreadsheet().getId(). See Google's guide to triggers for more information on onEdit().
Related
I want to get the price of an item which is market in steam. I tried to use this formula but it is not working it tells me that the value is too big. and I did not know what to do. I want to get the price of an item which is on market on steam.
Blockquote =VALUE(REGEXEXTRACT(REGEXEXTRACT(CONCATENATE(IMPORTXML("https://steamcommunity.com/market/listings/730/Clutch%20Case", "//script[2]")),".*]]"), "[0-9]+.[0-9]+"))
The main problem here is that the prices in the Steam page are generated by Javascript and IMPORTXML cannot retrieve dynamically generated data. It seems that you're trying to get around this by importing a <script> section, but this will not execute the script, you're just grabbing a bunch of code.
According to this answer, Steam has some endpoints that you can use to get market data. These return a simple JSON string with the item information. The endpoint looks like this:
http://steamcommunity.com/market/priceoverview/?currency=1&appid=[ID]&market_hash_name=[Item name]
The appid is the game's ID, and the market_hash_name is the URL-encoded name of the item. Conveniently you can already find these in the URL that you are already using, https://steamcommunity.com/market/listings/730/Clutch%20Case. The game ID is 730 and the name is Clutch%20Case. So you can plug these in to the endpoint to get this URL:
http://steamcommunity.com/market/priceoverview/?currency=1&appid=730&market_hash_name=Clutch%20Case
The endpoint's JSON looks like this:
{
"success":true,
"lowest_price":"$0.30",
"volume":"94,440",
"median_price":"$0.31"
}
Since you only care about the median price, we can use a formula with REGEXEXTRACT to extract only that part:
Here's a sample pasting the URL in A1.
=REGEXEXTRACT(JOIN("", IMPORTDATA(A1)), "median_price:""(\$[0-9]+.[0-9]+)")
Edit: As mentioned in the answer I linked, you can test the currency parameter in the URL with different numbers to get other currencies. In your case you can try currency=2for pounds (£). You'll also have to edit the REGEXEXTRACT to account for this change:
URL: http://steamcommunity.com/market/priceoverview/?currency=2&appid=730&market_hash_name=Clutch%20Case
Formula: =REGEXEXTRACT(JOIN("", IMPORTDATA(A1)), "median_price:""(£[0-9]+.[0-9]+)")
I have a column of URLs that is created automatically when a Google Form is submitted using the "Add Form Edit Response URLs" script. What I would like to do is copy that link to another sheet and wrap it in text. Like this [EDIT] , but automatically with every link in the column. I know I can do it with =HYPERLINK("https://urllink", "Edit"), but I want it to happen automatically down the entire column as new entries are added.
Thanks!
I figured it out: =ArrayFormula(IF(N2:N="","",(hyperlink(N2:N,"EDIT"))))
I have a database of elements, each element has its own QR Code. After reading the code I would like to be able to open the worksheet on a specific tab and jump to the appropriate cell (according to the element name). Calling a worksheet through a URL with the #gid parameter allows you to open a tab.... the "range" parameter allows you to jump to a specific cell.... and what if I want to search for an item by name? Something like: https://docs.google.com/spreadsheets/d/1fER4x1p.../edit#gid=82420100&search=element_name.... is it possible?
Google has not introduced this yet
But you can look into Google Script (Googles SpreadSheets macros like) to achieve this.
Also a simpler approach will be to just filter the data, but this will change your requirement obviously. For example you can create a Filter with the name you are looking for and then you will get the URL.
This is the URL to a Sample of this, it should open the
Spreadsheet and filter the data when loaded. This is the Icon to
look for to create the filters
here is some documentation for you to get started on Google App Script, but I don't have a direct link to let you know how to catch the parameters for it to process them. What I can tell you is that this is a much more complicated approach than just a URL because it involves programmatic processing on the Spreadsheet side.
I am trying to implement data from my google spreadsheet into a google-chart element of polymer 1.0.
Is there a simple way to define the source of the data?
I do not want to use cols and rows since my spreadsheet is updating itself frequently.
What I would like is to use something like the data=' ' object to define the url of the spreadsheet and also the range, e.g. C3:C8.
But the docs say i should use a .json format, and I do not know how to get that from google spreadsheet.
This is what I am using:
<google-chart type='line' options='{"title":"Line Chart"}' data=''></google-chart>
Is it possible to use the url and range of the spreadsheet?
I think you will want to use <iron-ajax> and serve the data as content from your Google Apps Script doGet() function hosted by your spreadsheet. Assign the returned data content to a property in your custom element. Then bind your data attribute to that property.
You can pass the range variable as parameters in your <iron-ajax> call that you read in using doGet(params).
This question already has answers here:
Scraping data to Google Sheets from a website that uses JavaScript
(2 answers)
Closed last month.
Using this webpage as an example http://forums.macrumors.com/showthread.php?t=1688317
On a google spreadsheet, the following DO NOT work with importxml():
//a[contains(#href,"showpost")]/#href
//a[contains(#href,"showcount")]/#href
//*[#id="postcount18545482"]
The last one (//*[#id="postcount18545482"]) was copied directly from Chrome's element viewer.
The following DO work but exclude any results with the word "showcount", "postcount", or "showpost":
//div[contains(#id,"post_message")]/#id
//a[contains(#href,"show")]/#href
//a[contains(#href,"post")]/#href
Is there something special about the word "count" when working with importxml() or XPATH? How can I get the missing entries?
ImportXML function in Google Docs spreadsheet can not process data that is created in a two-step process. For example, when an authentication token must be retrieved first before making the url request, or when the URL tells the server to dynamically create an xml output after which the user is redirected to the output, even when the URL stays the same. You might want to look into Google Apps Scripts (http://code.google.com/googleapps/appsscript/index.html) to handle this case.
Taken from here
In your particular case the anchor parameters get set in the vbulletin_post_loader.js script called after the page container is loaded.
...
pc_obj=fetch_object("postcount"+this.postid);
openWindow("showpost.php?"+(SESSIONURL?"s="+SESSIONURL:"")
+(pc_obj!=null?"&postcount="+PHP.urlencode(pc_obj.name):"")+"&p="+A)
...
In other words, when importXML() scans the page, the nodes containing 'showpost' or 'postcount' in href are not yet on the page:
Looks like importXML() works with static pages only and not able to handle dynamically loaded content.
Try to find another way of obtaining the number of post in a thread.