23

The question: https://stackoverflow.com/review/low-quality-posts/17716516 displays a code block and asks

Code blows on MailApp line with message "invalid email: Range". I don't understand the error message. Please help.

To which I responded with:

The error is saying that your var Addr = dataRange.getCell(1, 11); call is getting a result of a Range, so when you pass that to the sendEmail function it says Invalid email and shows the value to be Range.

You can confirm this by console.log(Addr); before the call.

The question asked for the meaning of the error message, I believe @Barmar has provided the cause in his comment that you are referencing the title of the column instead of the current row due to using '1' instead of 'i'.

Yet one low-quality-posts reviewer wrote

This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post.

I'm struggling to understand how that review is valid, the question is answered, I edited my post when further information was provided by @Barmar to keep it as complete as I could and gave him credit for it, I would delete mine if he came back and added his own answer, but now someone else will write the same thing.

Can anyone give me some insight into why my post was deleted so I can avoid the unpleasant way I am feeling in future?

7
  • 4
    hmm.. I would have skipped this one. Although just by viewing the answer itself it doesn't look like it is providing a solution for the error and is pointing out the meaning of the error which could be a comment.
    – Suraj Rao
    Oct 24, 2017 at 11:33
  • 8
    As one of the reviewers that voted to delete, I think that I could messed up on this one. I reckon I got confused by the second part of your answer, where it seems I interpreted that you were referencing another user's comment as the correct answer for this question. It's not a particularly nice answer, but on reflection not deletion worth (although the question itself probably is).
    – yivi
    Oct 24, 2017 at 11:37
  • Thank you @yivi I appreciate that insight, that makes sense to me how it could be interpreted that way.
    – Anthropic
    Oct 24, 2017 at 11:42
  • 1
    I've casted an undelete vote. I could only suggest to add what you actually will see if you do console.log(Addr);. You could also repeat the correct line of code at the end, saying something like: You fix the error by doing [code here] assuming the proposed fixes from the comments indeed fix the root cause
    – rene
    Oct 24, 2017 at 11:48
  • Truth be told I would actually delete it now anyway, Phil provided a comment which I think should be the accepted answer if he posted it as one. But I do appreciate it @rene
    – Anthropic
    Oct 24, 2017 at 12:03
  • 10
    Yeah, keep it deleted. This kind of Q+A was a big reason why SO was created in the first place. Back in the bad old days a forum post like this would seed search engine hits, only for visitors to find out that it is nothing but a simple typo and utterly useless to address their problem. That such a question can't get enough close votes anymore today, even after 17 hours of visibility, 6 reviews and an hour of meta exposure is pretty sad. Back to the bad old forum days. Oct 24, 2017 at 13:09
  • 7
    @HansPassant Actually, it isn't a case of just "a simple typo". Whilst the 1 in dataRange.getCell(1, 11) maybe should be an i, this is not the cause of the error message. As Phil rightly points out in his comment, all the dataRange.getCell(...) statements need to be changed to dataRange.getCell(...).getValue(). This is clearly a useful question for people (like the OP) who don't understand that getCell() returns a Range object and not the actual value of the cell.
    – robinCTS
    Oct 24, 2017 at 15:37

2 Answers 2

28

I believe that the reviewers who voted to delete acted in error here. What you posted was an answer to the question.

I'm not sure what misled them. Perhaps the bottom paragraph, where you reference a comment? Not only is that paragraph unclear, I frequently see this mislead reviewers, who think that an answer is an attempt to reply to a comment, when it is really an attempt to promote a comment to a proper answer (with the appropriate attribution).

At any rate, I've undeleted your answer. It qualifies as an answer by our standards, and it was inappropriate for it to have been deleted.

At the same time, I've also closed the question, because it is one of those situations where the answer is unlikely to be helpful to anyone else in the future, and thus does not need to stick around. It was clearly not a quality question in the first place, and in the future, you might consider whether your time could be better spent crafting an answer for other questions.

9
  • 2
    Thank you Cody, it seemed like such a simple question and easy to answer at first, easy rep points to get me over the 500 line so I can start helping on review queues myself. I guess just like everything in life you have to watch out for the ones that seem too good to be true! I will be more cautious on the "easy" ones moving forward. Thanks again.
    – Anthropic
    Oct 24, 2017 at 15:13
  • Sounds like the asked-about-answer might be a good review audit one. ;) Oct 24, 2017 at 15:46
  • 4
    I'm confused. Why is it that "the answer is unlikely to be helpful to anyone else in the future"? This is clearly a useful question/answer for people (like the OP) who don't understand that getCell() returns a Range object and not the actual value of the cell. Yes, the question title needs improving and the code snippet could be shortened/completed. And yes, the answer needs the incorrect last paragraph removed or replaced with one that correctly attributes the cause of the error to Phil's comment. But once these are done I can't see any problem.
    – robinCTS
    Oct 24, 2017 at 15:48
  • @robinCTS what's stopping you from actually asking and answering that question?
    – Braiam
    Oct 24, 2017 at 16:55
  • 3
    @Braiam The fact that it would be a duplicate of the question whose answer is under discussion here. It would therefore also be subject to closure under the same, unknown to me, reason that applied in this case. That is why I'm asking for an explanation. Once I have it, yes, if appropriate, I will post such a question/answer.
    – robinCTS
    Oct 24, 2017 at 17:23
  • @robinCTS no, it would not. Because it is closed and will be deleted. A desired question has never been closed as duplicate of a undesired one (at least in theory), so both questions despite having the same potential answer, will not be duplicated questions. You can't claim that a question that doesn't fulfill any closing criteria is duplicate of one that does.
    – Braiam
    Oct 24, 2017 at 18:05
  • 5
    @Braiam Fair enough about the duplicate - didn't really think it through enough. Still waiting on the explanation to determine what needs to be different with my question/answer so it doesn't get closed.
    – robinCTS
    Oct 24, 2017 at 18:35
  • @robinCTS well, I don't know how to ask a good question about that problem. How would you ask a question about that problem?
    – Braiam
    Oct 24, 2017 at 22:52
  • 3
    @robinCTS If you can see a way to improve the Q&A, making it more general and more searchable, then it could definitely be re-opened. This is why the site is collaboratively edited, and with your reputation level, you can make these edits with minimal overhead. That's why we give users these privileges! Oct 25, 2017 at 9:28
1

When answering a question, you can be pedantic and answer the actual question asked, or you can try to understand the problem and post a solution.

You opted for the first, which IMHO in this case resulted in a warranted Not An Answer flag.

The question:

I don't understand what the error message means, and so can't figure out why the code is not working.

With the answer:

The error is saying that your var Addr = dataRange.getCell(1, 11); call is getting a result of "Range", so when you pass that to the sendEmail function it says Invalid email and shows the value to be Range.

Besides being incorrect (the statement yields an object of type Range, which is stringified to "Range"), it's not helping the OP that much towards a solution. Especially since it doesn't answer the second part of their question, repeated:

can't figure out why the code is not working.

Every question containing an error message implicitly admits that the asker doesn't understand the error message. Answering "Why am I getting an IndexOutOfRangeException?" with "Because you're providing an index that lies outside the bounds of the array" is stating the obvious.

An explanation of the error is always useful in an answer, but an answer should, especially in such cases, contain a solution as well, which your last revision does.

6
  • A sincere effort to answer the question that was asked is Not An Answer because the author didn't navigate the XY issue in your opinion? This seems out of line with the guidance in Your answer is in another castle: when is an answer not an answer?.
    – Kenster
    Oct 25, 2017 at 15:42
  • My opinion on the matter is summarized in the first sentence of my answer. Just as an asker will be blamed if they ask the wrong question, an answerer who (deliberately or not) answers the wrong question shouldn't really be surprised if their answer disappears. There has been enough controversy around NAA already, but we definitely shouldn't hand out upvotes to users who post answers that don't address the real problem in the question.
    – CodeCaster
    Oct 25, 2017 at 16:09
  • Also, debugging hints go in comments, unless the actual question asks for debugging hints, in which case it's probably too broad and/or a duplicate. I'm simply of the opinion that the answer under discussion here, at least in its first revision, shouldn't have been posted.
    – CodeCaster
    Oct 25, 2017 at 16:13
  • @CodeCaster, just to clarify so you don't have the wrong impression, I wasn't being pedantic, not at all, I do realise I gave that impression with the first edit referencing the additional comment, but I simply answered the question as I read it. I felt that not being able to understand the error is the root cause of the poster's not being able to solve the problem in the first place.
    – Anthropic
    Oct 25, 2017 at 23:58
  • Also I corrected the answer within the first 20 minutes regarding the mistaken usage of quotes around "Range" so all the deletion reviews were well after that change. I don't know why I quoted it the first time, an error on my part.
    – Anthropic
    Oct 25, 2017 at 23:59
  • I will certainly ensure future posts are more inline with the sort of answer now showing rather than the first attempt. Thank you for taking the time to respond on an already accepted question, I value your time and appreciate it along with your feedback!
    – Anthropic
    Oct 25, 2017 at 23:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .