Search code examples
google-apps-scriptvar

Google-apps-script debug: The resource you requested could not be located. (line 175, file "Code")


This is my first post here and I am really a newbie when it comes to programming so please be kind if I am making a fool of myself. I have a script which updates my google contacts on submitting a new google form which has been running well for the last 3 years and stopped working a few months ago. I haven't changed anything in the script nor the form so not sure why it stopped working nor how I can fix it. Can you help?

I receive this error notification: The resource you requested could not be located. (line 175, file "Code")

This is what I have on line 175:

if (YourAddress && YourAddress!='' && YourAddress!=' ') newContact.addAddress(ContactsApp.Field.HOME_ADDRESS, YourAddress);

I have checked the Var definition in line52-53 and it seems correct:

case "Your Address":
YourAddress = itemResponse.getResponse();

Anything you can suggest to fix my issue? THANK YOU SO MUCH!


Solution

  • You error is due to a bug, which has already been filed twice on Public Issue Tracker

    See here and here. I suggest you to give the issues a "star" to increase visibility and hope that they will be fixed soon. In the mean time, you can try one of the workarounds other people with the same problem suggest, e.g.:

    if (YourAddress && YourAddress!='' && YourAddress!=' ') {
      ContactsApp.getContactById(newContact.getId()).addAddress(ContactsApp.Field.HOME_ADDRESS, YourAddress);
    }