I'd like to be able to track clicks from a webpage to a google sheet via json, how can I increment values on a sheet?
What I'm looking to do is display one of these codes randomly on a page and log copy clicks (there's a button to copy the code via javascript)
How to:
increment the clicks
locate the cell to increment the clicks
Is this something that's possible w/ google sheets?
I just coded a bitly style google sheet web app and show you how to do it here: https://www.youtube.com/watch?v=1SCtkLc-uFQ
in short you get the values from the column of Codes and then you find that index of the clicks column. Then increment by one.
Related
I have a google sheet that uses an app script button to send the values from that sheet to another sheet. If someone forgets to press enter after filling in their information, it will not send the last cell value.
So if the cell previously had the value of 3, then we change it to 4, but don’t press enter, it will send the value of 3.
The solution, I think, is at the beginning of the function for it to submit somehow, or press enter, or select another cell, anything that works. But I can’t figure out how to do that so far.
I’ve tried various things but I can't find the right apps script function.
So far without pressing enter, or clicking on another cell, I am unable to access that cell value. Changing the active selection doesn't work.
const sh = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("L1");
// change the active selection to another cell, but it just moves the 4 to the new cell
sh.setActiveSelection('A1');
In Google Sheets, it's not possible to force the cell edit submission (a.k. pressing enter) on behalf the active user. If training your spreadsheet users doesn't look a good solution, then you should consider another way for data entry, i.e. make a form in dialog/sidebar so you can use client side HTML/CSS/JavaScript to control your form.
I am working on a google spreadsheet for my team members where they can save their logs so I have made a separate sheet for each of them but I do not want to let them see each others logs due to some privacy reasons.
I am hiding sheets with the app script and associated them with the email address of the users. But when any user opens his/her sheet then it works just fine, but if other users open their sheets then it get messed up.
If user A open A1 rest other sheets are hidden, but when user B opens B1 then it gets rendered to user A also. I can't understand if its because the google spreadsheet has only one instance or its some fault in my code.
Unfortunately your approach is not feasible
As you suspected, the google spreadsheet has only one instance.
So if one user performs any change on the visibility of a sheet, this change will be also visible to all other users that work on the same spreadsheet.
As a workaround, you can create a separate spreadsheet for each user that cannot be accessed by other users.
Those spreadsheets can be synced to a common master spreadsheet that can be seen and edited by you.
You can do this sync with a simple =IMPORTRANGE() formula.
Is it possible to record when a user clicks on a hyperlink in a cell, such as adding a timestamp to another cell?
I've done some looking and all sources I've seen say that this is an onclick event, which isn't possible to record in google sheets.
It's not possible to track click on arbitrary links in Google Sheets cells as one Google Apps Script there isn't a on click trigger.
I have a google spreadsheet that stores data at my work and is constantly being updated via google drive so it is always online editing, what I want to do is to be able to extract the values in those cells and have them show up in a HTML5 table on my website, what would be the best solution for this?
I did try one way which was to just embed the spreadsheet in a iFrame and have that refresh every 5 minutes, but the refresh loading is too slow and it causes issues with trying to get the spreadsheet to fit perfectly in the iframe everytime I refresh. these websites will be on display on TV screens so I dont want to be adjusting them regularly, they will auto refresh and be idle.
Your Google Sheet's rows/columns can be exported as a pretty minimal HTML table. You can grab that HTML and manipulate it however you like. Here's how to get it:
Open the Sheet and find your file_id in the URL, and the gid for the specific tab you wish to export (you may have several spreadsheets within a single Google Sheet).
Use this URL string, replacing <FILE_ID> and <TAB_GID> with your own:
https://docs.google.com/spreadsheets/d/<FILE_ID>/gviz/tq?tqx=out:html&tq&gid=<TAB_GID>
You can set the refresh/recalculation rate under File > Spreadsheet settings to be every minute, if necessary.
Example:
Here is a Google Sheet with some data. To export this as an HTML table, we take:
the file_id: 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms and
the tab_gid: 0
from the URL and substitute those into the URL string (above), yielding:
https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/gviz/tq?tqx=out:html&tq&gid=0
Hope that helps. 🍻
I'm brand new to coding extensions for chrome so I'm hoping someone here can help or point me in the right direction.
I'm looking to create an extension that when you click on it a drop down comes up with 2 text inputs that will allow me to edit a google doc spreadsheet on the fly. Specifically, I'm tracking customer issues for my site and need to continuously add the number of times per day an issue arises.
So in the first text input box I would like to enter #issue click "Track" and it would add a +1 to the corresponding issue's cell within the Google Doc. In the second text input box if I enter #issue2 textdescription and click "create new issue and track" then the function would create a new row describing the issue (text description) and create a rule that from now on when #issue2 is entered in the first "Track" input box then a +1 will be added to that corresponding cell.
I have been able to create a popup box with inputs, however I am having trouble figuring out how to create a function to carry out what I would like to have done to the Google Doc Spreadsheet.
Hopefully, this isn't too wordy :/
Chrome extensions is not the way to go.
Look at google apps script. Use a menu, sidebar or both.