[HELP] Google Sheet App Script : Transpose reponses from a Google Form

117 views
Skip to first unread message

Sophie Gentis

unread,
Sep 13, 2022, 4:12:30 AM9/13/22
to Google Apps Script Community
Hi everyone,

I really don't know much about coding. I work for a school and I have a Google Form to call the register whose answers arrive in a Google Sheets in this format:

Timestamp,I am...,[Student1],[Student2],[Student3],[Student4],[Student5],[Student6],[Student7],[Student8],[Student9],[Student10]
09/11/2022 16:33:32,Teacher1, Away, Away,Late,,,,,,,
09/12/2022 16:34:32,Teacher2,,,, Away,,,, Away,,

I would like the responses to come in this format:

STUDENT,TIMESTAMP,TEACHER,TYPE
[Student1],09/11/2022 16:33:32,Teacher1,Away
[Student2],09/11/2022 16:33:32,Teacher1,Away
[Student3],11/09/2022 16:33:32,Teacher1,Late
[Student4], 09/12/2022 16:34:32, Teacher2,Away
[Student8], 09/12/2022 16:34:32, Teacher2,Away

I guess I can only achieve this by doing a macro in Apps Script. Could you help me ?

Thanks a lot !
Répondre à tous
Répondre à l'auteur
Transférer

CBMServices Web

unread,
Sep 13, 2022, 1:21:26 PM9/13/22
to google-apps-sc...@googlegroups.com
Hi Sophie,

If it is just a question of the order of columns, you can move columns in the spreadsheet to the order you want and the Google form will still work correctly and place information in the new correct order.

Be careful you do not delete any columns though..

If it is consolidation of information, I can help, but will need more details on what exactly you need done.


--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/3f4e91fb-ae72-47f2-86d0-c3ae30e6b2e8n%40googlegroups.com.

Sophie Gentis

unread,
Sep 19, 2022, 5:48:47 AM9/19/22
to google-apps-sc...@googlegroups.com
Hello,

Sorry for the delay.
My problem is not the order of columns but all the spreadsheet structure. 
In The Google Form I ask the teacher to check off the students who are away or late. So in my spreadsheet i have 1 column by student and 1 row by day (1 row by Form completed).
But i need 1 row by student away to be able to process absences 1 by 1 (columns = student, date, teacher, away or late)

Thank you for your help !


 Sophie Gentis 
Responsable Qualité & Outils Pédagogiques - DPO

Mail : sge...@escaet.fr

Port : 06 37 98 52 71
Tél : 04 42 96 64 97

6 Avenue de Grassi, 13100 Aix en Provence

LinkedIn (Personal)FacebookTwitterInstagramYouTube
 www.escaet.fr


You received this message because you are subscribed to a topic in the Google Groups "Google Apps Script Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-script-community/3nWiWNv83qE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/CAFX%2Bz3VVBjfR1_EtL7ULQJqiChEW_BFZQK3dORvjy9s%3D2sT6FQ%40mail.gmail.com.

Andrew Roberts

unread,
Sep 19, 2022, 6:08:31 AM9/19/22
to google-apps-sc...@googlegroups.com

Sophie Gentis

unread,
Sep 19, 2022, 6:34:08 AM9/19/22
to Google Apps Script Community
Hello, thank you very much !!!
It works perfectly :)

Sophie Gentis

unread,
Oct 5, 2022, 5:52:39 AM10/5/22
to Google Apps Script Community
Hi Andrew,
Do you think possible to create a new row only for each cell not null returned by the form ?
In your sheet I created 2 tabs "copy of..." to see what I meen.
Thank you very much !
Sophie

Andrew Roberts

unread,
Oct 5, 2022, 9:21:19 AM10/5/22
to google-apps-sc...@googlegroups.com
Yep, it is simple enough to ignore the empty ones. Code updated.

Sophie Gentis

unread,
Oct 5, 2022, 3:06:06 PM10/5/22
to Google Apps Script Community
Marvelous !!! 
Thank you very much Andrew !!! :D
Reply all
Reply to author
Forward
0 new messages