I have a google form with multiple sections. Section 1 is just a date input.
Section 2 - 13 are exactly the same as each other, they have the following example questions:
- Colour
- Size
- Age
- City
- Another? [yes/no]
Saying yes on the final question proceeds to the next section, therefor allowing you to capture another "set" of data. Saying no submits the form.
My form submission thus looks something like this in the Responses
sheet:
Timestamp | Date | Colour | Size | Age | City | Another | Colour | Size | Age | City | Another | etc.. |
---|---|---|---|---|---|---|---|---|---|---|---|---|
25/07/2022 21:09:19 | 21/07/2022 | Blue | XL | 25 | NY | Yes | Red | S | 22 | TX | Yes |
The columns Colour, Size, Age, City and Submit thus repeat in the columns, either with data or blank - depending on how many times Yes was selected at the end of the sections.
What I am trying to do is turn every "set" of Colour, Size, Age and City into a row of it's own on another sheet. So the final sheet would look like this:
Timestamp | Date | Colour | Size | Age | City |
---|---|---|---|---|---|
25/07/2022 21:09:19 | 21/07/2022 | Blue | XL | 25 | NY |
25/07/2022 21:09:19 | 21/07/2022 | Red | S | 22 | TX |
etc... |
The timestamp and date should be at the start of every row, while the respective sets of Colour, Size, Age and City are appended to the bottom of this new Data
sheet with every form submission.
I would also want to avoid blank rows, so only append to the Data
sheet if there are values in the sets of responses.
Any assistance for how this google script should look would be greatly appreciated.