Google Script e.range is object Object instead of object Range

跟風遠走 提交于 2019-12-24 17:24:44

问题


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.

来源:https://stackoverflow.com/questions/49833096/google-script-e-range-is-object-object-instead-of-object-range

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!