Update Multiple google Sheets using script from a master sheet - javascript

Can anyone assist with updating multiple google sheets using java script.
I have 100+ google sheets with my suppliers, and I need a way to make updates to them all via a script.
For example. I want to be able to make changes to a central script which I have, that will add new data to to the Sheet Tab "Samples" in cell A1 for every sheet url with my suppliers.
I have a list of the unique URLs to add, I just need some help in creating a script.
There are obviously many other changes, but just getting a start will hopefully help me progress some.
Any help is gratefully received.

Related

Is it possible to change an external website through google sheets?

I just made my first useful program (javascript) last week, but it was exhilarating to realize that I never have to to this repetitive **** again. So bear with me, since I might ask a simple question.
I'd like to, from google sheets, create separate page for each client listed in the sheet, on my wordpress page.
Is that possible?
It's a simple question, but it might save me countless of hours figuring out how, if there's actually no way.
Google Sheets cannot do it by itself, but you can make a program which will download data from Google Sheets API and then by WP REST API create posts on your Wordpress site and put data as content.
Link to WP REST API
You can also make Wordpress site download data from Sheets and then create posts.
There is a third option: make Google Apps Script which will operate on Sheets and on WP REST API.

Publishing a Google Sheet cell to an HTML page

I'm trying to provide external websites that aren't controlled by me some information they need to publish such as live inventory data. I'd like to provide them some Javascript that they can put on their site that I can control via a Google Sheet.
Here's an example:
Google Sheet A - Column 1/Row 2 = 6
With this code I provide, the external web admin makes his page say:
"We currently have 6 cinnamon rolls available"
Then someone comes in and buys two rolls. I go to the Google Sheet and update Column 1/Row 2's cell to '4' and now that same page says:
"We currently have 4 cinnamon rolls available"
Essentially i'm trying to create a CMS controlled by Google Sheet cells. I've been scouring the web and can find some attempts made in 2011ish, but I'm hoping there is a way that is as easy as embedding a YouTube video.
There is no way that's "as easy as embedding a youtube video". You need to have a server that scrapes the content of the sheet then publishes it back out.
I found something that is close enough to what I was trying to accomplish at the time, so I figured I'd share. Sheetrock is a Javascript library that allows you to use your Google Sheet like a database.
http://chriszarate.github.io/sheetrock/

What the differences are between Google Tag Manager and Google Apps Script?

While looking to process a few variables from a form, and send that data to a Google Drive Spreadsheet, I found that Google Apps Script, fits better for my purpose, it just catchs all the data in a regular html form, and sends that data to my Google Drive Spreadsheet, without depending on a special type of google form, and without matching var names, vith values.
Am I missing something?
Regards!
Google Tag Manager gives you the power to create and update tags for your website and mobile apps, any time you want, at the speed of your business. You can go through the documentation here.
You can also refer to this page for more idea on what Tag manager is.
For your requirement of getting the data from a form to a Google Spreadsheet, Google Apps Script fits better.
You can refer to these links for more information of Appscript:
https://developers.google.com/apps-script/guides/sheets#connecting_to_google_forms
https://developers.google.com/apps-script/guides/html/
Hope that helps!

How do I export from an HTML table to an excel spreadsheet?

~Opposite of this question
I'm working with the google drive javascript API, and I've used it to add a "Save to Drive" button in my web application. With this save to drive button, it requires you to give the location of the file in order for it to be downloaded. Let me explain the page
There is an html form, and you fill out the fields and click "Check", it queries the database, parses those results into an html table that can be viewed from the webpage. The results aren't saved to a file. There's not enough space to scale a solution that saves these reports and keeps them on the server. To be clear here I am looking for being able to provide a downloadable spreadsheet generated from the html table.
There is webViewLink, but this implies that a file exists. Using PHP or javascript to make a temporary file out of the html data could work -- if there is no html to google spreadsheet converter, an html to spreadsheet parser would do the trick. But I'm trying to do this with as little custom coding as possible, as it is part of a larger project and I shouldn't get stuck on coding things that might already have robust solutions.
Even it being google drive isn't all that important. Are there other libraries that would make it easy to download html tables as spreadsheets? The reason I'm asking for a quick solution like a library is that this isn't a main feature of my project, otherwise I'd spend a bit of time on it. It's just something shiny that I can show got done during the timeframe, because higher ups don't appreciate back end refactoring as much as they should.
PHPExcel might work, but I get the feeling it will use storage on the server. The old system of copy pasting the data to a spreadsheet works too, but I'm trying to make it one-click, bam, excel sheet, without having to ask for a bigger VM
You can use jQuery to download an excel spreadsheet. Look at this JSFiddle
$("#btnExport").click(function (e) {
window.open('data:application/vnd.ms-excel,' + $('#dvData').html());
e.preventDefault();
});
Have a look here too. Next time, try widening your search criteria.
You could try Excel Online. This has a JavaScript API.
See http://microsoft-office-add-ins.com for more information.

In a Google Spreadsheet Gadget, how to write to the spreadsheet?

I am writing a gadget to be embedded in a Google Spreadsheet. Reading data using the visualization API (i.e. google.visualization.QueryResponse object) works fine, however I also need to amend some data in the spreadsheet from within the gadget.
Though having searched for it for a while, I have not found a way to do that. Does anybody know how I can modify a spreadsheet from within a gadget (basically Javascript running inside the spreadsheet)?
sheet.getRange(1, 1).setValue('your value');

Categories

Resources