How to Update Records in Salesforce Using Python

Josh C.
3 min readApr 20, 2020
Photo by Mika Baumeister on Unsplash

Hi! I came across having to update SalesForce records during a data cleanup project at work. I figured there were others out there that may want to know how to update records SalesForce as well. I’ll spare you the details on the messy cleanup! So, this guide will not focus on the cleanup efforts but, will instead serve as a simple walkthrough on how to update records in Salesforce.

The modules that are going to be utilized in this guide are:

Pandas

Simple_Salesforce

This guide was written under the assumption that you have the basic fundamentals of Python down.

If you do not have Pandas installed yet, use the following to do so:

pip install pandas

If you do not have simple_salesforce installed yet, use the following to do so:

pip install simple_salesforce

Now that you have the modules downloaded, you can start building your Python file.

You would start by importing your modules

import Pandas as pdfrom simple_salesforce import Salesforce

Next, you would create our SalesForce connection. Your account needs to have the ability to use the SalesForce API. Contact…

--

--