Remove the ms-outlook attribute added to your contacts

Like me if you had the unfortunate luck of using the Outlook app’s feature to sync your Gmail contacts to iOS and then used a sync app like Google Contacts sync you might have ended up with a whole bunch of contacts having an attribute called outlook with a value that says ms-outlook.

The fix is quite easy really. Using the awesome Script editor at https://script.google.com you can run this simple function to get rid of the stuff you don’t want.


function myFunction() {
  var contacts = ContactsApp.getContacts();
  for (var c = 0; c < contacts.length; c++) {
    var cnt = contacts[c];
    var fields = cnt.getUrls();
    for (var i = 0; i < fields.length; i++) {
      if(fields[i].getLabel() == "Outlook"){
        fields[i].deleteUrlField();
      }
    }
  }
}

Remove the ms-outlook attribute added to your contacts