I have a question regarding Google Docs and content controls (if there are any?)
We have a system that lets users design a MS Word doc with content controls (rtf text, comboboxes etc) and assign an ID to the control so that our system can pull the ID and register the answer. The data is then saved in a database.
What is a content control?
So my question is, is there any way to acheive this with google docs? I've been looking around but were unable to find a satisfying answer.
I would like to present users with a document in google docs that they fill in and return to me.
It does not have to be controls, but maybe sections that I can identify and pull content from with googles API.
You have couple of options:
Use the Form option in Google Spreadsheet. Check their tutorial at: http://support.google.com/docs/bin/answer.py?hl=en&answer=87809. They have a nice set of controls (checkbox, multiple choice...). You are getting the benefits of automatic update of the forms into the spreadsheet; no need to create a database...
A bit more complex (but still simple) option is to use Google Apps Script to write a small application GUI that works with the spreadsheet. You get more control over the GUI and all the benefits of automatic data storage, triggering events on each form submission etc. Check out this advanced tutorial: http://code.google.com/googleapps/appsscript/articles/building-sites-app.html
Related
I am looking to find out if it is POSSIBLE to restrict EDITORS from downloading, copying or printing a Google sheet or other documents in a Google Drive. We share sheets/documents with our customers so they can fill in the details. For that we need to make them EDITORS (so they can edit and even invite others to the party). I know that we can restrict COMMENTERS and VIEWERS from downloading, but in our case we need to prevent EDITORS.
We have a LOT of intellectual property in our sheets (custom formulas and approaches), and we would like to be able to prevent people from simply downloading it. As I understand it this SHOULD be possible using the Google Drive API, but I have not been able to figure out how to do it, yet. Looking at the API it obliquely says it MAY be possible, but it is not clear :-(
Direction, or sample code, would be VERY much appreciated.
TIA
It's not possible to restrict editors from downloading files. The documentation mentions that only commenters and viewers can be prevented from this. Then in the API docs concerning permissions and their definitions you will see that there's nothing controlling downloads either. This is just a UI change.
If you think about it, the reason is clear: Even if you manage to stop direct downloads, to anyone with at least read access to the file or API this is just a minor inconvenience. They can still read all the content and metadata from the API and replicate the file perfectly. Even viewers with copy disabled can still read the formulas from the formula bar. Sharing the Sheets file is inherently unsafe if you have confidential data in it, since a determined attacker can still get all your trade secrets easily. You're only supposed to share these files with trusted users.
My suggestion is to take a different approach. Do not share the Sheets file at all and use something else as intermediary to request data from your customers. For example:
Create a Google Form to save the responses to a Sheet. Your customers will only need to fill out the form and the sheet will be filled with data that you can handle on your side.
If you need the users to also view some information in the Sheet before filling out their info you can build an Apps Script Web App that displays only the plain data that you need to show them. With this you can hide the formulas and other sensitive information. Using templates and server functions you can allow the users to interface with the Sheet data similarly to how they do it now, but with a more restricted view. You could even allow them to edit only the data you want them to. This requires more work and is starting to delve into web development, but It's much easier than a fully fledged website since the hosting and interfacing with APIs is handled by Apps Script.
You could just create your own application and use the Sheets API to read and write data from the Sheet. This is pretty much the previous suggestion but much harder, though in the end it will give you more flexibility.
The bottom line is that sharing your Sheet in any way is akin to giving your users full database read or write access, and there's no single setting that can prevent that. Your best bet is to avoid sharing these files and use a different method to request user data.
I couldn't find any thread in the community about generating a Mekko charts just using GSheets.
Does anyone how we can do that?
Here's how to do it in Excel: https://www.mekkographics.com/how-to-create-a-marimekko-chart-in-excel/
I have figured out how to almost get there with some data processing. For example, let's review the GDP by country and source, to visualize its distribution. I was able to get the Mekko chart, but I'm missing the countries in the X axis.
Here's the data and spreadsheet: https://docs.google.com/spreadsheets/d/1xVFf8_pbVj45W39qDs7MY5cLE_zf1YlJcSzvqWfazg8/edit#gid=1149840583&range=V1
Answer:
Putting the names across the bottom isn't possible in this way, you will either have to do it manually with text boxes or use a chart subtitle to identify each column.
More Information:
There is a great tutorial on how to set up Marimekko charts in Google Sheets here which details how these charts can be made, though the takeaway here is that there isn't a direct way to add axis-labels using the chart itself.
Feature Request:
In this case, I would suggest that you let Google know that this is a feature that is important for Google Sheets and give them the idea to have it implemented.
From the Google Sheet UI (from the page in which you can see an open Spreadsheet), follow the Help > Help Sheets improve menu item and detail in the following Send feedback modal the information for this request.
Google's Issue Tracker also exists as a place for developers to report issues and make feature requests for their development services, though as this is normally for developer tools such as Apps Script or APIs, the best course of action would be the aforementioned Send feedback option from the UI.
There is however an already similar feature request on Issue Tracker asking for the inclusion of Mekko charts in Data Studio - this request can be found here.
I've found lots of examples of coding the deprecated UIapp forms, but very few using the new FormApp class.
What I need is essentially a Grid control that has text boxes for input in place of radio buttons - a table in other words! I'm finding nothing that shows how to set up a table with positioning or a container.
Any suggestions? Preferably I'd love a link to a site that details lots of examples of coding the FormApp as I'm sure this is just the start of a new learning curve.
Thanks!!
Google's FormApp is limited to a fixed number of Item types - just those that are provided by the Forms Service GUI. There is no way to create custom question types or layouts. I suspect the limited ability to customize is the reason you don't find much effort dedicated to creating script examples.
If the data you are collecting requires a different layout than any of the provided "Items", then your only practical option within the Google Apps Script world is to create a custom interface using UiApp or the HtmlService, and record responses into a spreadsheet.
Alternatively, you can submit a feature request on the Google Apps Script Issue Tracker. However, unless the Item already exists in Google Forms (Google Docs), it's unlikely to get any traction from the Google Apps team. (My opinion - I don't speak for Google.)
I have a web app that data is submitted from a Ui embedded in a Google Site and saved in a spreadsheet. I am thinking about switching to scriptDB instead, but I am unsure about querying and displaying data dynamically. The last time I checked it was not possible to refresh a sites page from within a script, so as a work around I wrote a .html page with javascript that accesses the spreadsheet via the key and uses the Visualization DataTables to produce a quick and nicely formatted query. I would like to retain this functionality if possible. Could anyone make some possible suggestions?
Regards,
Shawn
This is doable today via UiApp (see the Charts api, and note that you can add a Chart to a UiApp).
To auto refresh:
You can use CheckBox.setValue(value, fireEvents) - but you may hit quota issues (there is an example somewhere around). If you hit quota issues, then I suspect HTML service is your best option. It also gives you better control.
Here is an open item requesting expanded Charts service integration with Gviz.
Although, there is limited integration at present, it needs to be expanded to group variables in tables to facilitate basic count and sum operations.
I suggest you “star” the issue to vote for it and to be notified of new developments.
I would like to (programmatically) convert a text file with questions to a Google form. I want to specify the questions and the questiontypes and their options. Example: the questiontype scale should go from 1 to 7 and should have the label 'not important' for 1 and 'very important' for 7.
I was looking into the Google Spreadsheet API but did not see a solution.
(The Google form API at http://code.lancepollard.com/introducing-the-google-form-api is not an answer to this question)
Google released API for this: https://developers.google.com/apps-script/reference/forms/
This service allows scripts to create, access, and modify Google Forms.
Until Google satisfies this feature request (star the feature on Google's site if you want to vote for it), you could try a non-API approach.
iMacros allows you to record, modify and play back macros that control your web browser. My experiments with Google Drive showed that the basic version (without DirectScreen technology) doesn't record macros properly. I tried it with both the plugin for IE (basic and advanced click mode) and Chrome (the latter has limited iMacro support). FYI, I was able to get iMacros IE plug-in to create questions on mentimeter.com, but the macro recorder gets some input fields wrong (which requires hacking of the macro, double-checking the ATTR= of the TAG commands with the 'Inspect element' feature of Chrome, for example).
Assuming that you can get the TAG commands to produce clicks in the right places in Google Drive, the approach is that you basically write (ideally record) a macro, going through the steps you need to create the form as you would using a browser. Then the macro can be edited (you can use variables in iMacros, get the question/questiontype data from a CSV or user-input dialogs, etc.). Looping in iMacros is crude, however. There's no EOF for a CSV (you basically have to know how many lines are in the file and hard-code the loop in your macro).
There's a way to integrate iMacro calls with VB, etc., but I'm not sure if it's possible with the free versions. There's another angle where you generate code (Javascript) from a macro, and then modify it from there.
Of course, all of these things are more fragile than an API approach long-term. Google could change its presentation layer and it will break your macros.
Seems like Apps Script now has a REST API and SDK's for it. Through Apps Script you can generate Google Forms. This API was really hard to find by trying to google for it and I haven't yet tested it myself, but I am going to build something with it today (hopefully). So far everything looks good.
EDIT: Seems like the REST API I am using works very well for fully automated usage.
In March(2022) google released REST API for google form. API allows basic crud operation & also added support for registering watches on the form to notify whenever either form is updated or a new response is received.
As of now (March 2016), Google Forms APIs allow us to create forms and store them in Google Drive. However, Forms APIs do not allow one programmatically modify the form (such as modify content, add or delete questions, pre-filled data, etc). In other words, the form is static. In order to serve custom, external APIs are needed.