Skip to main content

Added v0.5

The salesforce connector supports reading and writing to/from Salesforce using SOQL.

Tabset

Read​

Recipe​

read:
- salesforce:
instance: sf.domain
user: user
password: password
token: token
object: Contact
command: |
SELECT Id, Email, Name
FROM Contact

Function​

from wrangles.connectors import salesforce
df = salesforce.read(
instance='sf.domain',
object='object',
user='user',
password='password',
token='token',
command='SELECT Id, Name FROM Contact'
)

Parameters​

ParameterRequiredData TypeNotes
instance✓strThe salesforce instance to read from. e.g. <custom>.my.salesforce.com
user✓strUser with read permission.
password✓strPassword for the specified user.
token✓strSecurity token for the user.
object✓strObject to read data from e.g. Contact
command✓strSOQL query.
columnslistA list with a subset of the columns to import. ID field must be included. This is less efficient than specifying in the command.
order_bystrUses SQL syntax to sort the input.
ifstrA condition that will determine whether the action runs or not as a whole.

Write​

Recipe​

write:
- salesforce:
instance: sf.domain
user: user
password: password
token: token
object: Contact
id: Id

Function​

from wrangles.connectors import salesforce
salesforce.write(
df,
instance='sf.domain',
user='user',
password='password',
token='token'
object='Contact',
id='Id'
)

Parameters​

ParameterRequiredData TypeNotes
df✓DataFrameFunction only. DataFrame of contents to write to the database. Columns must match the target schema.
instance✓strThe salesforce instance to write to e.g. <custom>.my.salesforce.com
user✓strUser with write permission.
password✓strPassword for the user.
token✓strSecurity token for the user.
object✓strObject to write the data to e.g. Contact.
id✓strIndicate the Id field. If the Id exists and is provided, the record will be updated, otherwise inserted.
columnslistSubset of the columns to be written. ID field must be included. If not provided, all columns will be output.
order_bystrUses SQL syntax to sort the output.
ifstrA condition that will determine whether the action runs or not as a whole.