I want to check information contained in a Google sheet, as the respondent is completing a form - google-sheets

We are using forms to allow people (staff) to book equipment out of a store, self service. We record who took what, and when they book it back in. They are asked if the tool condition is good, and if not, are taken to another part of the form to select a fault category. I record this information in the linked sheet.
so my question is can I read the information in the "fault" column of the linked sheet for that item ID, and generate a message to the form user such as "This item has been reported as faulty - please do not use it!" etc etc
If I could script the form so that it scans the linked sheet in the relevant column / row for the item they are trying to scan out, and then warn them that is has an entry in the "Fault" column, that would be perfect. Ideally as they scan the barcode of the item they are taking, before submitting the form, but after submit would be fine too.
I have searched widely and not yet found a solution

Since the only triggers which are available for Forms are the onOpen, onInstall and onFormSubmit, this cannot be done directly.
Possible solutions
1. You can develop your own form
This can be done by using Apps Script & HTML & JavaScript and creating your own Sheets add-on which will interract with the sheet you have in order to check the status of the tool.
2. You can programmatically update either the question name or the form description in order to include the accepted values for the question regarding the tools.
This can be done by creating a script attached to the sheet and using the onEdit(). So whenever a change is made in the tools section for example, this new data can be gathered as a string and update the fields to contain the updated values for the tools.
Reference
Apps Script Simple Triggers;
Extending G Suite with Add-ons.

Related

Is there a way I can pull unique links into a Data Studio report?

I'm self thought in data studio and am currently creating a database of all my companies customers. As a part of this database, I want our sales team to have access to all of the customers past and current information. This includes a unique link to a companies profile. We work off Google Sheets so I have a google sheets document with the customers information including the unique link. This would currently be fore 1,700 customers so I can't do them manually!
I want to make a nice button that would say "Customer profile" which would be created from this unique hyperlink. The only way I can figure out doing this is by using a one cell table and having the long hyperlink displayed. Is there a way I can use an image to create a unique button when the database is filtered? I.E if I filter the database to show company X's information a button will have their profile pulled from the sheet.
Additionally (a lesser question because it's more for ease instead of functionality), there is a form that our sales team can fill out during the call which I currently have embedded. Is there a way to embed a JotForm form through google sheets also? It means we would be able to pre-populate the form and the sales-person wouldn't have to waste time filling out a customer reference or company name etc.
Any help would be really appreciated! Please let me know if any more information is needed.
This is only an answer to your first question.
You can create a Calculated Field in your data source.
Here:
Let's say that you have "Company_Name" and "Website_URL" fields in your data source. Calculated Field will look like this:
HYPERLINK(Website_URL,Company_Name)
Then you name this field for example "Company_Website_Link" and add this to your work.

How can I link to Google Sheet from Google Form? (Exploring Make a Copy feature, but I need it to be shared with the original owner)

I'm posting here because I'm hoping someone can help me edit the link to a google sheet. I haven't been able to find the answer online, but I'm hoping maybe someone understands how the link works better than I and can give me an answer.
I've been tasked with updating the application for funding (from a non-profit) to include a budget category. The application is in Google Forms, but there's no way to insert a table into the form for an applicant to fill out. I created the budget outline in a Google Sheet, but now I'm trying to find the best solution to create an individual link within the form that will lead them to the budget document. Essentially, I'm hoping the applicant can fill out the form, and when they reach the section about their budget, I want them to click the link to the google sheet, have it make a copy, but have the copy be shared with the organization's google account so we can see it when they submit their application.
I've experiment with the forced copy feature (editing the shared link by google), but when I test it from a different google account than the owner, it tells me I have to request permission. The share settings are set to allow anyone with the link to access, so I don't understand why it's asking me to request permission when I open the force copy link. This isn't going to work because the applicants need to access it when applying, and we can't have them waiting for us to accept the request every time.
I'm sure there could be a few solutions, so I'm open to any advice. The only other solution I can possibly think of is creating individual links for each applicant, if there's a way to automate that?
I recognize there could be a solution where I ask the applicant to download the file and re-upload, or share it themselves, but our applicants are not native english speakers and they are often non very comfortable with technology, so I want to automate the process as much as possible.
To summarize: The applicant should be able to
Fill out the google form
Receive an individual copy of the budget document (from google sheets) to fill out.
The budget document must be shared with the original owner so we can see it and see how it relates to the rest of their application.
Thank you for your consideration!
A solution for your use-case would be to make use of Apps Script.
Apps Script is a powerful development platform which can be used to build web apps and automate tasks. What makes it special is the fact that it is easy to use and to create applications that integrate with G Suite.
Taking this into account, you can create a script which will create a copy of the document whenever a new form submission is made and add the permissions needed for the user. Essentially, you will be the one owning the copy of the sheet as well and the candidates will have edit permissions.
Therefore, the script will end up looking something similar to this:
Code
function onFormSubmit() {
let sheetId = 'ORIGINAL_SPREADSHEET_ID';
let form = FormApp.getActiveForm();
let responses = form.getResponses();
let n = responses.length;
let currentUser = form.getResponse(responses[n-1].getId()).getRespondentEmail();
let newSpreadsheet = SpreadsheetApp.openById(sheetId).copy("Sheet copy for " + currentUser);
let newSpreadsheetId = newSpreadsheet.getId();
DriveApp.getFileById(newSpreadsheetId).addEditor(currentUser);
}
Explanation
The above snippet makes use of the Apps Script's onFormSubmit installable trigger. Basically, whenever a new form submission is sent, the code above will run. The code will retrieve the last response which was submitted and get the user's email address by making use of the getRespondentEmail method. Afterwards, a copy of the original spreadsheet will get created and shared with the editor permission with the user who just submitted the form. Adding the permission is done by making use of the addEditor method from the DriveApp parent class. As for the user accessing the copy of the spreadsheet, this is easily done as the user will end up receiving an email telling them that a spreadsheet has been shared with them.
Setup
You will have to have the Collect emails option checked for the form;
Open the three dots icon and click on Script Editor;
Once you open the script editor, input the code from above and do not forget to modify the sheetId such that it matches the id of your original spreadsheet that you want to share.
Install the onFormSubmit trigger by going to the Triggers page and create a new trigger with the following options:
Send the URL form to the candidates and wait for submission to be sent.
Reference
Google Apps Script;
Apps Script Installable Triggers;
Apps Script SpreadsheetApp Class;
Apps Script FormApp Class;
Apps Script DriveApp Class.

data entry form in google sheet for multiple users not working when accessed simultaneously

I've created form in google sheet, so that multiple users can add data, modify & delete.
However, it is not working properly when multiple users are working on it simultaneously.
For an example, two people are working on the sheet. User A and User B. If user A is typing something user B is also able to see and user B will be able to enter the detail, but it will change the details which are being entered by user A. Technically same sheet is opened for both the users and details keeps on changing what users are changing.
Ideally, if user A is entering some details user B should not be able to see it and form should be blank or unique for user B, so that both the data won't clash. I want it to be like the way google form is there wherein form will be blank when any user is opening it. (I have tried google form for my work, but as there are too many drop downs google form takes time to load and work gets slow that the reason I am trying to find the option in google sheet).
google sheet link
Above is the google sheet which you can open and check the form and coding. Also, please test it with a different id to test for multiple users.
Let me know if there is any workaround for this. Also, let me know if you need any other details.
Answer:
This just isn't possible. Sheets is meant to be a collaborative tool; what's edited by one person will always show up for others. You need to use a different tool, for example like a Google form for data entry, but having data not being edited in other open versions is just not workaroundable.

Google Sheets - Make a tab change not visible to other users

I am trying to work on a google sheet where one Tab will be an entry form and another will be a database. I need the form to be used by multiple users. Currently the Form tab displays all changes to other users so multiple users cannot use it at the same time.
Is there a way to allow 1 user to see their own entries and a 2nd user to see different entries. When they press my button it should record their individual entries on the database tab.
I cannot use Google Forms for this project due to the complexity of the form and the need for cascading drop-down lists and dynamically available information on the form.
Thanks
After researching extensively, the answer to my question is that there does not seem to be a good way of doing this.
My final approach was to create a tab for each user with the calculations, cascading dropdowns, and buttons/scripts that affected their specific sheet and recorded data on the database tab based on their specific sheet.
Hopefully, this helps the next guy who is searching for this answer. If anyone has found a way to solve this, let me know so I can test and give you credit for solving what I could not.

Can I make a summary of only selected data?

I want to select only certain rows and columns and use the same "summary of responses" feature but for limited data rather than all of it. Is this possible?
The report is with ALL DATA from this sheet - I want the exact same output but with only certain email addresses.
Google Form: bit.ly/bilvalchal_results
If I have a google spreadsheet can I make a summary of only selected data?
Yes, but I think your Title may be misleading. I thought at first you wanted any summary but now believe you want the specific format provided by Form > Show summary of responses, and that is quite different.
Is this possible?
In essence, I think not. For example, in Excel it is easy enough to avoid charting data simply by hiding it. That seems not to work here. Even deleting data in the Form responses sheet does not change the Summary of responses.
This presumably because both the Form responses sheet and the Summary of responses are distinct views of server-side data. I doubt there is a means for a user to control the code that drives the Summary of responses, whose data is gathered from the individual form submissions (as is the data shown in the responses sheet). Submissions have spawned both the sheet and the Summary but the two are independent of one another.
On the other hand.
As mentioned by #zeroCoder, equivalent results might be obtained by a user though it would seem with a considerable effort. A script may be required to set the chart type to use for each question by question type (if to avoid an ad-hoc basis, Form by Form). Once the type appropriate to each column has been determined it would be a little tedious but not difficult to create the corresponding chart. Adjusting the formatting, scales etc to match that of Summary of responses would also be tedious but with a script would not need to be purpose-built for each Form individually.
That said, I hope I am crassly mistaken and that actually it is quite easy. I suspect however you would have heard by now were that so.
Another option is to use the Awesome Tables web app. It allows filtering of your data (and more). It is available as a gadget on Google Sites.
So this doesn't use the built in feature exactly but it does the trick.
Take your sheet with all the rows and figure out which columns you want to show.
Create a new sheet called preview or whatever.
in the top cell for each column reference the row from the responses sheet like this ={'Form Responses 1'!A:A}
Then hit File>Publish to web and chose to publish your Preview sheet only.
Get your shared link (shorten it if you must).
Post that url in your form only and presto.
You win!
You need to use pivot tables here are some tutorials on how to use them:
How to create a pivot table report
Summarize your data with pivot tables

Resources