TypeError: Cannot call method "replace" of undefined - Anyone Help???

496 views
Skip to first unread message

Mark Cheese

unread,
Jan 16, 2013, 4:09:23 PM1/16/13
to forme...@googlegroups.com
Hi,

I'm having an issue with regards the FormEmailer script.  I've installed the script within my form, and set up current script's trigger --> "ProcessManually" --> From Spreadsheet --> OnFormSubmission.

I have had this working perfectly up until last night.  I am not sure what I have done exactly (I haven't touched the script content at all!), but basically TWO things now occur:

1) If the process is set to run manually (FormEmailer --> Process Manually), an error message TypeError: Cannot call method "replace" of undefined  occurs and emails are repeatedly sent to all recipients even if it already says "Email Sent" or "Email not sent" in the FormEmailer Status column (first column).  This means everyone in the list gets an email re-sent AGAIN even if they have already received one from the time they submitted their form;   AND

2) The automatic trigger no longer works so submitting the form has no effect.

Would anyone have an ideas? I've tried deleting the script, uninstalling and re-uinstalling FormEmailer (version 3.62), but the same issue occurs.

Any help most appreciated!

Mark

Henrique Abreu

unread,
Jan 16, 2013, 5:32:08 PM1/16/13
to FormEmailer on behalf of Mark Cheese
Hi Mark,

When you uninstall the script, did you remembered to delete your config sheet?

When you pick "Process Manually", does the popup shows up for you to write the row number, or it start sending directly?
If it shows up, what do you write in it?

Try running the script from within the script editor to see the specific line where these happen.

Regards,
Henrique Abreu



Mark

--
You received this message because you are subscribed to the Google Groups "FormEmailer" group.
To view this discussion on the web visit https://groups.google.com/d/msg/formemailer/-/2lmcd-vu_WMJ.
To post to this group, send email to forme...@googlegroups.com.
To unsubscribe from this group, send email to formemailer...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/formemailer?hl=en.

Mark Cheese

unread,
Jan 16, 2013, 7:32:42 PM1/16/13
to FormEmailer on behalf of Henrique Abreu
Hi Henrique,

Thanks for your email and assistance.

So, yes the config file (FormEmailer sheet) was definitely deleted when uninstalled.

When I choose to run manually, I do get a prompt, and I usually tell it to run from line 2 (ie entering 2*).

I've tried running it within the script but the same thing happens.

Google has sent me this which may be of assistance: 
Details:
StartFunction

Error MessageTriggerEnd
1/16/13 8:34 PMprocessManuallyTypeError: Cannot call method "charAt" of null. (line 348)formSubmit


Does this help establish what the issues may be!

Kind regards,
Mark

Wysłane z iPhone'a Marka 
Sent from Mark's iPhone

Henrique Abreu

unread,
Jan 16, 2013, 8:04:36 PM1/16/13
to FormEmailer on behalf of Mark Cheese
Hi Mark,

Let's start with an explanation first. When you pick "Process Manually" and choose a line to be processed, it will be processed regardless of the status.
E.g. if you type line "3". It will process it (that is, send the emails) regardless of its status. That is not a bug, it's a feature.
When you pick "2*", you're just telling the script to send all emails again. That's just how it was designed.
If you want to process only the newest submits, first check which line they start, let's say 352, and inform it to the script: "352*".

From the error message it seems that you have set the "processManually" function to run on a form submit trigger. Is that right?
If so, you did it completely wrong. Please check this messages, where I explain this:
How to make this script work automatically?
Instant Email upon submitting a form

If you still have any doubts after reading them, please feel free to ask.

Kind regards,
Henrique Abreu

Dan Longley

unread,
Jan 19, 2013, 3:26:11 PM1/19/13
to forme...@googlegroups.com
Hi Henrique
I'm also getting the message TypeError: Cannot call method "replace" of undefined.
although everything seems to work brilliantly. Yes, I also set up the trigger incorrectly, I've now found your 'Setting Tips' and set up the trigger correctly. However, I still get this error message but only if I add the * in a manual process. Can you explain what this message means, then I can probably work out what is causing it!

I've been using an old 'on submit' version of your formemailer, love it, but want to be a bit more adventurous with the formulae, hence why I'm re-working my enquiry form.

Do I need to 'share' the spreadsheet with you? It's still in development, so nothing confidential in it.
Thanks
Dan

Henrique Abreu

unread,
Jan 19, 2013, 4:24:57 PM1/19/13
to FormEmailer on behalf of Dan Longley
Hi Dan,

This message was not written by me. It's an automatic message from the Apps Script system telling that the script did something wrong.
I don't really know why it is happening. I'll try to reproduce this later and if I can, I'll fix it. Thanks for letting me know.

Regards,
Henrique Abreu


To view this discussion on the web visit https://groups.google.com/d/msg/formemailer/-/Dlg3W9LtWrgJ.

Dan Longley

unread,
Jan 21, 2013, 3:22:54 AM1/21/13
to forme...@googlegroups.com
Hi Henrique
For your information, I had to redo the spreadsheet from the beginning because I wanted to tidy up the form, sheets, etc. The error message did not display when using the * in 'process manually' until... I set up 6 additional formula columns: email1-email6. I set up email1 and it worked fine when I processed 3 lines with * (no error message). Then I set up email6 and the message has started appearing when processing the same 3 lines manually! I didn't setup email2-5 (I just deleted my email address from the TO box in these so I wouldn't be inundated by these emails while testing).

Everything appears to work fine despite this error message!
Dan
Let me know if you want me to share the spreadsheet with you


On Saturday, 19 January 2013 21:24:57 UTC, Henrique Abreu wrote:
Hi Dan,

This message was not written by me. It's an automatic message from the Apps Script system telling that the script did something wrong.
I don't really know why it is happening. I'll try to reproduce this later and if I can, I'll fix it. Thanks for letting me know.

Regards,
Henrique Abreu

Henrique Abreu

unread,
Jan 21, 2013, 2:17:12 PM1/21/13
to FormEmailer on behalf of Dan Longley
Thanks Dan, this is good info. I would not have tested such a complex case.

Regards,
Henrique Abreu


To view this discussion on the web visit https://groups.google.com/d/msg/formemailer/-/RbNn7lzMA30J.
Reply all
Reply to author
Forward
0 new messages