2

I'm trying to figure out why the title and company fields for a contact are not being saved into SalesforceIQ. I'm getting the name, email, phone, address, company, and title from a CSV.

I then run process_contact(name, email, phone, address, company, title, all_contacts). I check each contact and their name, email, phone, and address are being saved into SalesforceIQ but their company and title fields are not being saved.

When I print title in set_contact_fields, the correct title for each contact prints out on both lines. I'm pretty confused at this point.

Here's the code I'm using:

def process_contact(name, email, phone, address, company, title, all_contacts):
    # if contact exists
    contact_id = get_id_from_contact_email(email, all_contacts)
    print 'contact_id: {}'.format(contact_id)
    if contact_id is not None:
        print 'updating contact'
        # update information
        return update_contact(name, phone, address, company, title, contact_id)
    else:
        print 'creating contact'
        # create new contact
        return create_contact(name, email, phone, address, company, title)


def create_contact(name, email, phone, address, company, title):
    contact = Contact()
    contact.email(email)
    set_contact_fields(contact, name, phone, address, company, title)
    return contact.create()


def update_contact(name, phone, address, company, title, contact_id):
    contact = Contact(contact_id)
    set_contact_fields(contact, name, phone, address, company, title)
    return contact.update()


def set_contact_fields(contact, name, phone, address, company, title):
    contact.name(name)
    contact.phone(phone)
    contact.address(address)
    contact.company(company)
    print 'title being set: ' + title
    contact.title(title)
    print 'title is set: ' + contact.title()

Thanks for the help!

5
  • Which python library are you using?
    – abhi
    Commented Jun 13, 2016 at 15:43
  • Is company the standard Account field or a custom field?
    – Dave Humm
    Commented Jun 13, 2016 at 15:50
  • I could not find a python library named SalesforceIQ on pypi.python.org
    – abhi
    Commented Jun 13, 2016 at 15:51
  • @DaveHumm company is a field that comes as part of a contact object, see here: api.salesforceiq.com/#/…
    – anon_swe
    Commented Jun 13, 2016 at 15:53
  • @abhi The library is called RelateIQ!
    – anon_swe
    Commented Jun 13, 2016 at 15:53

1 Answer 1

1

From the link you've posted in the comments, just these properties are supported.

Currently, the following properties are supported by Contact object:

name
email
phone
address

7
  • Just noticed that. But if you look at how they create an example Contact object, they do set the title and company :(
    – anon_swe
    Commented Jun 13, 2016 at 16:15
  • @bclayman You may want to look at other libraries, this one looks somewhat limited.
    – Adrian Larson
    Commented Jun 13, 2016 at 17:08
  • @bclayman Can we get a developer account for salesforceIQ?
    – abhi
    Commented Jun 13, 2016 at 17:10
  • @abhi Not sure what you mean...elaborate?
    – anon_swe
    Commented Jun 13, 2016 at 17:10
  • Just to be clear - SalesforceIQ is a product and RelateIQ is the library being used. I am not sure if any other library exists for SalesforceIQ at this time.
    – abhi
    Commented Jun 13, 2016 at 17:10

You must log in to answer this question.

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