Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8746293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:10:19+00:00 2026-06-13T12:10:19+00:00

I am simply trying to use google apps script code to create a new

  • 0

I am simply trying to use google apps script code to create a new contact, and label the email field as “Work” because it defaults to “Home” when it is created. (I am trying to do this using a form, but for test purposes, it’s a simple Run trigger)

I have tried so many different iterations that there are too many to list here. But my latest workaround (as all things are with google) is to let the thing create the default “Home” email field when the contact is created, then add a “Work” field email, and then delete the “Home” – but the deleteEmailField which is listed in the google documentation never works.

Here is the latest I’ve put together:

function testAddcontact() {
var firstName= "Contact"
var lastName= "Test2"
var email= "testy@test.com"
var newcontact = ContactsApp.createContact( firstName, lastName , email );
newcontact.addEmail("Work", email);
newcontact.deleteEmailField("Home");
}

I have tried so many variations that I can’t provide all the code I’ve worked on here, but I have inserted above my latest attempt.

Thoughts anyone on how to create a contact and label that email address “Work” instead of the default “Home”?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T12:10:20+00:00Added an answer on June 13, 2026 at 12:10 pm

    This snippet should work:

    function testAddcontact() {
      var firstName= "Contact"
      var lastName= "Test2"
      var email= "testy@test.com"
      var newcontact = ContactsApp.createContact( firstName, lastName , email );
      newcontact.addEmail(ContactsApp.Field.WORK_EMAIL, email);
      var emailArr = newcontact.getEmails(ContactsApp.Field.HOME_EMAIL);
      emailArr[0].deleteEmailField();
    }
    

    just remember that:

    standard labels are Field objects

    deleteEmailField is a EmailField method

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use the example Social Mention RESTful API described here http://code.google.com/p/socialmention-api/wiki/APIDocumentation Simply
I'm trying to simply use a vector within one of my classes. When trying
I am trying to simply use a custom view helper that is located in
I am trying to use google fonts in a simple website. The tag that
I am simply trying to display a google map within a jquery mobile page.
I'm trying to update some existing code that normally runs a Perl script which
I'm very new in appengine development and I'm trying to develop some tests apps
Simple problem, actually. I am trying to evaluate the possibilities of Google Apps, using
I've been trying to figure out how to use the Google account manager to
This question is quite specific to the code i'm trying to use, 1st ill

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.