How do I mass change contact fields with Python?

I know how to connect to Infusionsoft with Python and how to process the following example:

#Set up the contact data we want to add
contact = {}; #blank dictionary
contact[“FirstName”] = “John”;
contact[“LastName”] = “Doe”;
contact[“Email”] = “”;
contact[“Company”] = “ACME”;

But how do I mass update the WHOLE database? e.g. If I want to update ALL The Phone1 fields with an extra bit of code using IF statements.

Help would be much appreciated.

The API does not support mass updating contacts. You can, however, mass update contacts using the web application:

  1. Go to CRM > Contacts.
  2. Narrow your search.
  3. Select the contacts.
  4. Go to Actions > Mass Update Contacts.
  5. There you can choose which field(s) to update and what value(s) to assign to the field(s) on those contacts.

Thank you Chris, I am not sure how to ‘swap’ phone1 with phone2 “IF” phone1 starts with e.g. “07” using the Actions above?

Hmm… :thinking: You could export as CSV, edit, then reimport or use the API to PATCH.

The edit could be something like a formula in Excel or something fun with sed/awk or a CSV tool.

Thank you Mike.