I work for a non-profit that holds free sports and physical activity events. I'm am trying to set up a system to store and collect information about our membership and the events we hold, using Google Docs as the user interface and Google Cloud SQL for data storage.
Like most non-profits, we do not have a lot of resources available for advanced computer programming. I would like to use Google Forms as a simple UI that our research and evaluation staff can use to build data collection tools without coding. The ease of access to the responses in Google Sheets is great; however, we hold a lot of events and will quickly exceed the 2 million cell limit. So, I think we will need to store the responses in a SQL database.
What I would like to do is modify the action performed on submit, such that the form:
Does NOT submit to a sheet
Connects to a SQL table (I've set this up on Google Cloud SQL)
Dumps the responses into the correct columns
If the form was modified, add any new columns to the table (like Forms does with attached sheets).
I know that Google Apps Script can connect to external databases through the JDBC service (https://developers.google.com/apps-script/guides/jdbc) and I know that I will need to use the getItemResponse method (https://groups.google.com/d/msg/google-appengine-stackoverflow/laLkcneaqZo/PfPKKYlmva8J) to execute this.
I have very little experience with Google Apps Script or JavaScript in general....basically, the most I've done is finish the Codecademy JavaScript course. However, I am a quick learner and I'm looking for a little example code that might get me started (remembering that I have almost no experience).
I've searched through this forum, GitHub and everywhere else I can think of, but cannot find something that is quite right. I'm mostly pointed to the JBDC documentation, but do not know how to use it. Any help you can provide would be much appreciated.
Brett
I wrote some articles about this at my blog, Bit Vectors. This article might cover most of what you need. That specific article explains how to build a Google Apps Script solution tied to a Google Sheet file. The GAS solution front-ends Cloud SQL. The end-user sees a web page / form, and if you want, the Google Sheet itself. To answer your list items:
1) The web form does write to a sheet, but in the software, you can easily prevent this
2) The web form definitely connects to your Cloud SQL table / database
3) The solution writes to the table(s) / column(s) you want through stored procedures
4) The solution will not modify the data table structure if you change the form - you would have to handle this change yourself
See a demo here.
HTH!
Frank
Related
I am a spanish speaker I will try my best in English I hope I made myself clear enough.
During many years I have been working on a spreadsheet (google sheets) for a company, to be used as the main database and management system, where you can find customer info, you can see all the purchases made by that client, you can get a list of clients that need to be reached, you can find the prices list for the products, product information, you can use it to input the orders, print every order and track it until delivery and payment, and the order itself also feeds stock, create an order to refill stock,
It is also used to calculate the payment for the salesmen, create statistics and get sales trends, etc. It includes almost everything the client needs, it's pretty cool. Everything created in google sheets. No macros needed so far.
The thing is that now the client needs to make the same system but more friendly to be used for non experienced people (almost none IT knowdledge, I mean, at all!).
I am not sure what platform should I choose to create this system, it will be starting over, but I cannot wait to start working on this new chalenge.
The good thing is that I have now some knowdledge in JS and I am learning also HTML and the tools to develop web pages. Not sure if I can use any of these to work on this project. What do you recommend? Thanks in advance.
This question is fairly vague, but I'll try to recommend something despite that.
Since you said you'll be "starting over", it sounds like you wouldn't necessarily have to use a Google Sheet.
This is a fairly difficult undertaking for someone inexperienced, especially since it's being developed for a client, but I'd recommend:
Use a SQL DB like Postgres to store the data.
Use something like Express to handle requests, and render pages.
Use some basic HTML+CSS+JS to make nice-looking pages.
And just build a web-app.
You could go other routes, (i.e. keep the "DB" in Google Sheets and use the Google Sheets API, and just use HTML+JS+CSS on static pages), so don't take my opinion as the only route
I'm currently working on a Chrome Extension which searches for specific content within webpages.
Now, my idea is to build a Database based on the correctness of this search result (which would be verified by the users), so it can be more accurate in these searches as the database grows. Kind of like a Machine Learning process I guess.
I'm fairly new to programming and I would like your advice on what are the best possible ways to do this.
Currently I just have JS/HTML/CSS, and it seems to me that I'm gonna need some other language.
A single CSV that the Extension could read/write would be enough for this, I think. Or something with SQL.
Thanks in advance!
You have to compose and post a CRUD command to a web server page (a server you own or you controll)
That page can be written in php, asp.net..
Web server page receive the CRUD command and run the relevant statement on your database via OBCD driver (or other similar driver)
Normally the web server page then responds, as a result of your post, with a message (text, xml, json) that makes you understand if the command has been successfully executed or not.
EDIT 04/30/2021 16:24 Rome Timezone
you say:
which would be verified by the users
what did you mean exactly?
more users together contributes to make the shared database better ?
or every single user contribute by itself to make his own database better ?
if one then my previous answer could be a good start point.
if two, forget my previos answer a think to build a indexedDB within your extension.
Read a csv or txt file through XMLHttpRequest is not a problem, but how do you thing to write the same file with the same tool (XHR) ?
You could think about a Google public spreadsheet.
"Google Sheets" allows you through an "endpoint url" and a set of API to insert new rows\records and to read the entire content of the spreadsheet
or (if I remember correctly) part of its content.
I state that it's now 2 years or maybe more since I got interested in Google Sheets.
Based on the information in my possession, perhaps outdated,
I can tell you that "Google Sheets" it is a path that I DO NOT advise you to follow.
First, because spreadsheet url being public would allow an attacker to pollute your DB by inserting many rows\records
by simply typing a url in the browser's address bar or creating a simple bot that inserts thousands of lines in a while.
Second, because that set of API do not allow you to implement very sophisticated queries (certainly not at the database level).
If you are really interested in Google Sheets I suggest you check what I have just stated.
If you have to "waste" energy to learn something new
I would suggest you to give priority to SQL and then to a server-side programming language (php, asp.net, node.js)
However, a free space hosting service with php and mySQL support is not too difficult to find.
I have a lot of data entry ahead of myself and looking to automate it a little. Part of my work involves entering confidential scoring values via a secure Javascript form; the values exist in a Google spreadsheet (think "Good" or "Bad" or "Average" as an example of one of the parameters). I've done it for years manually but trying to see if there's an existing script someone has for this exact purpose. I'm a terrible programmer :(
Thanks to any who may have some advice.
Some more information about the javascript form would be helpful. Is it publicly accessible (ie. could a script even reach it)?
Zapier has some tools that let you sync spreadsheets with other systems without writing code but it depends on your specific system:
https://zapier.com/apps/google-sheets/integrations
Google also has some sample scripts that you can repurpose, but some coding might be required to make them work with your system:
https://github.com/gsuitedevs/apps-script-samples/tree/master/sheets
Our ecommerce platform will does not currently create invoices. I have an invoice template that I currently use in excel, so I essentially just copy and paste about 8 points of data from the ecommerce platform to the spreadsheet, then print it out.
Even though the ecommerce platform does not create invoices, that data can be sent anywhere I would like, including a website or email, so I've used it to automatically notify me of certain purchases via email.
What I am wondering is since the variables (eg. user_address) are always the same that are sent from the platform, can that information somehow be sent to an excel spreadsheet (my template), which will then be populated by the appropriate variables, so all that's left to do is print it out?
I'm not really a programmer, so any code snippets you can provide or some idea of whether or not this will take a programmer would be appreciated.
Yes, check out Apache POI, this would let you create something in Java, perhaps a servlet, that would catch the data from your ecommerce app and make a spreadsheet.
Alternatively you could make a Google Spreadsheet and an associated form and write some intermediary script in whatever language you like that will send the right post variables to the Google form from the ecommerce app. I would expect this solution to be much less involved.
I would suggest taking a look at APIs like JExcel, which lets you read/write cells of an Excel file using Java. If you send your data to an Excel file, and then pull it out using this package, you could get the desired results. You may still need a programmer for this method, although there would not be a lot of work involved.
I need to create a webtool that takes several input values and generates a number of outputs based on complex sequences of arithmetic calculations in an Excel workbook. I am thinking of hard-coding the formulas into Javascript and creating a live-update user input form, but I don't want to waste my time if there is a more efficient way of doing this...I have heard of embedding live spreadsheets in webpages but realize this is only compatible with IE, which is not preferable. Does anyone have suggestions to help get me started?
You would need more than javascript to accomplish this. Despite the web guru naysayers, I made it work. You need IIS and Excel on the server. People are getting hung up on the 2nd requirement, but you have to use what is available. SpreadSheet Gear is an alternative.
But the first question you should ask yourself, do you really need a web front-end? I would explore building your front-end in excel; having a cell mapping tab that maps your UI elements to the cells of your calculator spreadsheet and have a macro copy/paste the contents from one spreadsheet to another.
The beauty of this set-up is you can run batch through your calculator spreadsheet.
You could use Formula.js, which is a JavaScript implementation of Excel's formula functions.