Excel Spreadsheet to HTML Chart dynamically - javascript

I have an excel spreadsheet that is going to be updated monthly and then displayed on a Blackberry browser. I've already created a website that has all the spreadsheet information in their statically and uses HTML definition lists and CSS to create charts.
I'm looking for a way to load a new spreadsheet into the server each month and have the website update accordingly. I've started creating JavaScript variables in the HTML page so they can be changed whenever a new dataset is received. However, I'm struggling with how to set the data to the variables without manual entry. Any suggestions?

There are javascript codes to read CSV files.
Just search for: javascript CSV
Take CSV2TABLE as an example:
http://plugins.jquery.com/project/csv2table

Related

How to create Google Sheets Macro/Apps Script to Open Newly Added File and Copy Data to Master?

I would like to create an automatic process with Apps Script to trigger on newly added excel files in Google Drive, open them, and copy the new data and append it to last row in the Master Google sheet.
The data would also need to be manipulated a bit as it comes in the format below. There will be several blocks like this for every vehicle. I would like the script to populate the vehicle # in each of the rows of available data for that vehicle in a separate column, in this case 6 rows. Then copy the data between rows labeled VEHICLE and VEHICLE TOTALS and paste it into the last row of the Master google sheet.
Data Table Example:
This looks to have a lot of working parts, so it'd be hard to cover in one response. But here's how I'd go about it...
Create a trigger
Scan the folder to find docx file
Convert docx file to Google Doc
Pull data from doc file to sheet
Manipulate data accordingly Write to appropriate location
Create a trigger - This might be the hardest part. I don't think dropping it into a directory can trigger a script. Instead, you can have your scripts timed, trigger them manually, or trigger based on an event within another G Suite document (sheet, docs, forms, etc.) Maybe you can just create a Google Form that you upload the file to?
Scan the folder to find docx file - Once it's somewhere in your GDrive and you've trigger a script, you can find it using the Folder and Folder Iterator classes
Convert docx file to Google Doc - Looks pretty straightforward Docx to Google Doc using Google Script
Pull data from doc file to sheet - A combination of the Document class, Spreadsheet class, and Google Script programming know-how.
Manipulate data accordingly & Write to appropriate location - Same as above.

Embed google sheets w/o updating source

I have a published Google sheet and I would like to use it in a website.
What I want is to have something such a "local copy" of that sheet, that is when I update sheet on my website the update remain local.
I will use this sheet for an order form, so every user of my website should have a empty version of sheet.
Is there any way to do this?
Just a a proposal & I hope it works in your case.
Separate the file into Master sheet (Sheet1) & Input Sheet (Sheet2)
File A contains Sheet1&2
File B contains Sheet2 only
Share only file B on the website.
But (when the time comes to sync the info) copy File B Sheet2 content to File A Sheet2. And all the formula inside it (Master sheet) should work just fine.

Google script to automatically add predetermined file paths to Google form response

I have little to, really no coding experience. Spare for a bit of HTML, CSS, and AppleScript However, I'm not sure where else to go in terms of insight on this question. Currently I am creating a Google Form for colleagues to submit work orders that will be recorded on a Google Spreadsheet.
But, I need to figure out how to write a script that will automatically add a specific file path next to files uploaded to the form.
For example, if a user uploaded a file named "061217_VideoAuthor_Slide1.mp4" instead of the Google Drive link (which is what is automatically populated with this file upload form option) I need that file name to be recorded and then it's cell needs to be changed from a Google Drive link to a specific file path
(Ex. /user/editor1/template/061217_VideoAuthor_Slide1.mp4)
Is there anyone that can point me to a sort-of specific tutorial or some documentation that could help me figure this out?
You can run logic every time the form is submitted that looks at the values in the sheet and augments them as needed.
Here's a walkthrough someone else put together:onFormSubmit
Your goal could be achieved by running a script every time a form is submitted, on certain schedule or by demand.
You will need to use JavaScript to get the file Id from the file URL, then get the file by using first getFileById(id) and getName() method from the Google Drive Service to get the file itself and its name respectively.
By the other side, instead or replacing the file URL I suggest you to add the file path to another column, just in case you need it later.

Render html (or html output) to Google Drive Docs(word) using javascript

I have an project where I have to render the html form output to an new google docs(word and NOT THE SPREADSHEET !) The only thing what I can find on the internet is about spreadsheet.
The project.
I have an html with form.
I need to get all the data in a new file in google docs when i click on submit.
Can someone show me a way how to solve this.
Hint Links etc etc.
Try following this code:
function myFunction() {
// Create and open a document.
// Replace with your own document name
var doc = DocumentApp.create('Document Name');
var pages = doc.getBody();
pages.appendPageBreak();
pages.appendParagraph("A paragraph.");
pages.appendPageBreak();//push additional data to the next page
pages.appendParagraph("A paragraph 2.");
}
This code will let you create a document and write in the pages. Also read Document Service, this service allows scripts to create, access, and modify Google Docs files. There are alot of features you can use to make your document more presentable.
Now, you connect your form to apps script. Just follow the steps done in this tutorial. Publish your code as web app, then use the web app URL to pass the variable to your script and save the data to the document.
Hope this helps.

Google spreadsheet with hyperlinks via JSON

I'm using json-in-script to put content from a Google Spreadsheet on a web page. The spreadsheet has hyperlinks on some of the text in the cells. JSON doesn't seem to be getting anything other than the plain text of the spreadsheet, and no markup like hyperlinks. How do you get hyperlinks? Can you with JSON?
This is the src of what I'm importing:
http://spreadsheets.google.com/feeds/cells/0Aipg92XowKCndHhtbnZXQkllWEUzUjBEc3NkQXppdnc/1/public/values?alt=json-in-script&callback=cellEntries&min-row=2&min-col=1&max-col=7
This is the link to the spreadsheet (see how the items in col1 are linked?)
https://spreadsheets.google.com/spreadsheet/pub?hl=en_US&hl=en_US&key=0Aipg92XowKCndHhtbnZXQkllWEUzUjBEc3NkQXppdnc&output=html
Can anyone advise me how to get the hyperlinks?
Thanks!
You'll want to do some post-processing, checking if a value matches a URL. If it does, create your own tag for it.
Use one of these:
http://www.google.com/search?q=url+regex
Also, you know that you can embed Google Spreadsheets directly in a webpage? I'm guessing you're not doing this because it would use an iFrame, and what you want is the actual data?
Rather than using the Google Speadsheets API (which is quite cumbersome), you should use jsondata.com. It'll let you upload all the data from a .csv and embed it in your site with YouTube-style embed code.
The post processing is a piece of cake when you get your entire dataset to your application in a nicely formatted JSON object.

Categories

Resources