Google Script e.range is object Object instead of

2019-08-04 02:12发布

问题:

I have this simple code that i'm using for testing. I have an "on Form submit" installable trigger on my spreadsheet that runs every time a form is submitted. I need to know the range where the response was copied and the responses.

So, i'm using this code

function myFunction(event) {
var Response=event.values
var Rango=event.range
var Row=Rango.getRow()
}

The event.values works properly but the event.range does not. Insted of getting a object Range it's returning object Object.

This is what the error says

TypeError: Cannot find function getRow in object [object Object]. (line 4, file "Code")

It's pretty weird because the code worked properly before.

To be more specific:

  • I'm testing this by submitting the form.
  • I know that the event.values works fine because i added a line of code to send me an email with the event.values and event.range content.
  • Actually, i could access to the content of this object Object by using Range["rowEnd"]. But before i could simply use Range.getRow() because this Range variable was indeed a Range object.

This is the spreadsheet link: https://docs.google.com/spreadsheets/d/1G6fXTkcbibxUZ29cxVTwkNzL5nircsIz2F573IXIUf4/edit?usp=sharing

this is the form link:https://docs.google.com/forms/d/e/1FAIpQLScvHD13JVpMHh3eikRseBbOu6OYlkacK_mkMotVJi9bI_MK0g/viewform?usp=sf_link

Update: After several weeks of trying a lot of things i just realized that is a permission bug (i guess) i reseted all permissions from the security panel of my google account and granted permissions again and DONE.