Data entry form responses directly to a template - google-apps-script

I have created a data entry form in Google Sheets, and would now like the data to be placed in my templates cells automatically. The user fills out a form, and ideally the answers would fill out the template and execute the calculations automatically. Is this possible?
My key questions are to
create a new tab with a template for each new data entry (results in a row in the data tab)
place entry-values to the tab to execute the calculations
I can also create many duplicate tabs of the template and place each answer to the specific cell manually, but I don't know how many entries there will be.
I have tried to create a new tab with new entries, but the tab is missing my template. I tried to link answers to specific cells, but did not know how.

If I understood correctly, you are using Google Forms to collect data and store the responses in a Google Sheet.
If that is correct, the best way to manage that input data adding calculations or other extra fields is to use a different tab.
F.e, if your form is collecting responses in tab "Form A", then you need to
Create another tab (let's say "curated A responses")
Import the data from "Form A" into the second tab
Add more fields, calculations, charts... whatever you need.
The simplest way to perform step 2 y using ='Form A'!A:A for column A and so on.
You write that into the first column of the second tab and it will populate existing and new values automatically.

Related

Data entry form (search, add, edit, delete) for more than one row - google sheet

Is there a way to work with data entry for more than one row through a form in Google Sheet or a tool to add, search, modify and delete ?
Maybe the dialog form best for my order
First: Save Data button
Add a button in the form to add more than one data entry row at a time before saving
For example, adding more than one product type for a supplier
Second: When searching
Enter the supplier code in the cell (D3) to call all the supplier data rows from input and output
Third: When modification or deletion after the search
Allow selection to modify or delete a row from the called rows
Example Form
Source of the article
Form Proposal

SELECT and COPY row to another SHEET in Google Spreadsheets

I'm currently working on a Spreadsheet, and I'm up to the point of creating either a button or checkbox to SELECT and COPY a row to another sheet as part of an efficient archiving system. For e.g. the user will select their row, click the button and the row will be copied in the mentioned sheet. I'm still quite new to scripting in Google Spreadsheets as a whole. I personally wanted to head into the direction of using a button, but I'm open to suggestions.
Thank you all!
I think that works (you will be assigning a script/function to an image you upload, and then in the function use .getRow() on the active cell). Here is some advice that could save you some time. For your use case, instead of using a button, consider using the QUERY command:
You have a table in "sheet1" with some columns:
In that table you have an IMPORT column. You can use data validation on that column so that it is a Yes/No dropdown as well.
In a separate sheet, you write this which picks out all the rows with "Y":
=query(sheet1!A2:D1000,"select A,B,C where D='Y'",0)
And that will output this (minus the headings, which you can customize based on the last argument of the QUERY command):

Google form inserts sheet row in unexpected location

I am having a strange issue regarding in which row of a linked sheet a google form places a new form row. Normally, each form submit adds a row to the sheet, starting with row 2 (row 1 is the header), as expected. If I delete all the rows in the sheet, form submits restart at row 2, as expected. But, now suppose I manually populate say the first 10 rows of the form (again, leaving row 1 as the header, so rows 2-11). Now when I do a form submit, I would expect row 12 to be added to and so on but instead, form starts at row 2 and wipes out my pre-populated row data. It seems that the form and the sheet have an internal "next row number" that is not based on the actual contents of the sheet. Can anyone shed any light one this?
I run into same problem. And found solution (after 2 hours of digging, where is the problem)
You need to use a function
sheet.insertRowsBefore(rowIndex, numberOfRowsToBeInserted)
first to create new rows (space) for your data and AFTER add your data to those created rows.
You can add new rows manually in google sheets of course - it works the same.
Explanation: There is an internal form property which holds a row index where a new form submissions will goes after a form submit.
When you only fill data, the index for new form submissions stays at previous position, so it rewrites your (any) data in cells.
Expect similar behavior when deleting a row data - if you delete only values (by delete key for. eg), then there will stay empty row when new form submission appears. Again you need to use function sheet.deleteRow(index) to delete data and change index of new row for new submissions.
Sounds like you are using the getActiveCell() or getActiveRange() method to find the last row. Whereas, you should be using getDataRange() method to get the last row and columns. getActiveCell() or getActiveRange() methods point to the location of the cursor on the Spreadsheet. Hence, if at the time it was at Row 1 - Col2, that's where it'll insert your info. Refer to this documentation for more information.
This happens by design so that form submissions never overwrite user inserted data. This is well demonstrated in this response[1].
I believe you could resolve problems if you create a script to insert your older data using the createResponse() method[2].
[1] https://support.google.com/docs/thread/10244473/google-forms-inserting-at-top-of-sheet?hl=en
[2] https://developers.google.com/apps-script/reference/forms/form#createResponse()

Google Form Event / Spreadsheet Cell Move Query

I'm no programmer or anything of the sort. I have a Google form whose output I need to manipulate in a particular way.
The obvious stuff: When a response comes in I provide my folks at work a cell on the sheet that contains a copy of the form's output, outside of the form data area, to indicate that a particular individual has taken ownership of the response and indicate next steps--call this "spreadsheet only data". No problem adding a cell or two of course. However, as responses come in, the list will get long. So I'd like to sort based off of the response timestamp to bring current responses to the top. Again, no problem...for the form data. However if I sort all new responses to the top my spreadsheet, the "spreadsheet only data" will of course not move with the associated form data. Google forms are easy until you need to track additional data after form submission.
I have tried to abandon sorting and use a script I found to send users to the last edited field, thus providing the ease of sort without the sort problems, but that is just confusing for multiple users. Google does not provide a way to insert cells per se, but it does seem to let me get ranges and move them...as best as I can tell from pawing at the intricacies of scripting found in these forums and the older. This is beyond me if possible, but would it be possible to write a script that on form submit triggers to select a range of columns and move all of those selected cells down 1 row? I don't want to specify selected rows to be moved, just columns, given it is indeterminate how many may be present at any time.
To be clearer, I hope, the issue is that, when sorted, the "spreadsheet only" data will not move down with each new form submission, I hope to find a way to rectify that so that my folks aren't scrolling forever to get to their new response, as they would if I just kept the form data unsorted, and since multiple users make the any "go to last edited cell" solution problematic (the only other solution I can think of to make the unsorted list user friendly enough to where folks wont hate the process).
Thanks for anything anyone can do.
You can set up a filter by selecting just the header rows from the form submission table (gray box) and selecting "Filter" from the "Data" menu. This filter is also added to the "Spreadsheet Only" column as well.

Linking google forms to master & children spreadsheets with automatic updates

I have a two-part question about master/child relationships in workbooks. I have beginner experience with writing code for excel & google spreadsheets so any extra detail would be truly appreciated.
Here is what I'm trying to achieve:
I want to make a google form to collect a set of data for (potentially 100's of people). The option to make changes to the form after submission will be enabled, so the data flow will be pretty dynamic. I've gotten as far as setting this up and creating the master spreadsheet where I can view all of the responses. But there's too much information in one spreadsheet and I'd like to make some child-workbooks to simplify the viewable data for various needs. So here are my questions:
1) How would I write the script to create a child worksheet from the master worksheet with these conditions: on run create a new worksheet called i.e "Child 1-Basic Info", delete all the columns and shift left with the exception of the ones I explicitly want to keep (based on the cell value) i.e "Name", "Age" & "Interests". Bear in mind I would want to eventually create multiple children workbooks, but basically do the same job each time. Just different column parameters i.e "Child 2-Education Info".
2) Along with this, I want to make sure that these children will be automatically updated every time someone submits a new response from my form or updates one they have already submitted. Essentially, the goal is to have any changes in the master ripple into all of the children. Also keep in mind that every time someone submits a new form, the row numbers will change. So the children will need to also recognize this change and update accordingly.
Thank you all in advanced!
With the QUERY() function, you can have secondary sheets that will dynamically update, with no need to use scripts at all. See more here.
Here's an example, a spreadsheet with rows of form-submitted data:
On a secondary sheet in the same spreadsheet, cell A1 contains a query formula that selects only the columns you asked for, "Name, Age, and Interests".
Every new form submission or update will result in recalculation of the query, so it will be kept up-to-date with no further intervention.