Help. I am stuck

101 views
Skip to first unread message

Usama Naeem

unread,
Dec 26, 2022, 3:24:36 PM12/26/22
to Google Apps Script Community
So I have a HTML Page which sends data to Google Sheets (Via Javascript in HTML to App Script Function which then writes to Google Sheets). Its a 2D Array and it gets passed correctly into App Script Function. However when I paste Array using SetValue, it does not get pasted correctly i.e. it overwrites the row (for example Array[2] may overwrite data of Array[1]. Can anybody help me?

Scott Bennett

unread,
Dec 26, 2022, 3:47:33 PM12/26/22
to google-apps-sc...@googlegroups.com
Are you using setValues() or setValue()?

Scott Bennett


Sent from my iPhone 

On Dec 26, 2022, at 3:24 PM, Usama Naeem <usaman...@gmail.com> wrote:

So I have a HTML Page which sends data to Google Sheets (Via Javascript in HTML to App Script Function which then writes to Google Sheets). Its a 2D Array and it gets passed correctly into App Script Function. However when I paste Array using SetValue, it does not get pasted correctly i.e. it overwrites the row (for example Array[2] may overwrite data of Array[1]. Can anybody help me?

--
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/37468c09-c2a5-4c5a-8c3d-f06a230d4361n%40googlegroups.com.

Ed Sambuco

unread,
Dec 28, 2022, 7:42:49 AM12/28/22
to google-apps-sc...@googlegroups.com
You need to show us the code .. but it sounds like an indexing match problem between arrays and sheet row (arrays from 0, sheet row values from one) or some error in how the sheet range is specified for setValues().

Reply all
Reply to author
Forward
0 new messages