Questions tagged [simple-salesforce]

simple-salesforce is a basic Salesforce.com REST API client built for Python 2.6, 2.7, 3.3, 3.4, 3.5, and 3.6.

Filter by
Sorted by
Tagged with
0 votes
0 answers
37 views

Scratch org: call REST APIs via simple_salesforce

I have a very simple python 3.x script that is getting errors when attempting to connect. So far, it simply consists of: from simple_salesforce import Salesforce import pandas as pd sf = Salesforce(...
0 votes
0 answers
50 views

Json Deserialization failed on token and has left off in the middle of parsing a row

I am trying to bulk load a csv file with 11000 records using Python with the simple-salesforce API. The error that I am running into is that when I try to load the file, I get this message: {'created':...
  • 121
-1 votes
1 answer
115 views

Redirect Error with Simple Salesforces and Requests

I have a python script that pulls specific reports out of Salesforce everyday. However recently the script started returning the error requests.exceptions.TooManyRedirects: Exceeded 30 redirects. ...
1 vote
1 answer
104 views

Encoding and Decoding Base64 Python / Salesforce

I’m working on a small python script to export ContentVersion records from one Salesforce org and migrate them into another. I’m using simple-salesforce. I am able to export the ContentVersion and the ...
1 vote
0 answers
62 views

Simple Salesforce how to create Custom Big Object?

Is there a way to create Custom Big Object with the simple salesforce metadata API? This is my approach: idx_field = mdapi.IndexField( name="MY_ACCOUNT_ID__c", sortDirection=&...
  • 11
0 votes
1 answer
31 views

Changing Case Owner in With sharing class

I have few question on "with Sharing" and "without Sharing" keyword in apex, In my Org the OWD for case is Public read only. I have one class where i am updating owner id of the ...
1 vote
0 answers
74 views

Encode/Decode ContentVersion Rest API Export and Upload [duplicate]

I’m working on a small python script to export ContentVersion records from one Salesforce org and migrate them into another. I’m using simple-salesforce. I am able to export the ContentVersion and the ...
0 votes
1 answer
66 views

How to fetch validation rules with Python's simple_salesforce?

I want to do something like from simple_salesforce import Salesforce, format_soql sf = Salesforce(username=..., password=..., security_token=..., domain=...) result = sf.query(format_soql("...
  • 13
0 votes
0 answers
34 views

Populate Picklist/Choice with SimpleSalesforce

I'm using the SimpleSalesforce API to query and filter records to a dictionary which I can also put in a dataframe using Pandas. I am trying to use this information to create some sort of picklist or ...
0 votes
1 answer
2k views

SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED]

Following details I gave and try to connect salesforce via simple_salesforce, Salesforce(instance_url = 'https://********.my.salesforce.com', username = 'asdasd@asd.com', password = '...
  • 101
0 votes
1 answer
72 views

Filter Case_Created__c, Datetime format issue, Python SOQL

New to SOQL and using python to script SF object pulls. I am pulling from Case and need just when Case_Created__c > 2020-12-31, but am getting a error with the DateTime format issue. For other ...
0 votes
1 answer
132 views

How can I get key prefixes of each object from a Salesforce Instance with pythons simple_salesforce API?

I want to extract keys for each Salesforce object (including custom) from a Salesforce environment via the simple_salesforce python library. That is, I want a pandas dataframe that looks as follows: ...
  • 13
0 votes
1 answer
293 views

How to update object description using simple_salesforce

I would like to set the description for all object fields that are layoutable but not present in any layout to: "Not used". I found out how to find fields that are layoutable, but I can't ...
  • 149
2 votes
2 answers
280 views

No such column 'Description' on entity 'EntityDefinition'

I'm trying to retrieve object descriptions with the following SQL query: obj_info = pd.DataFrame(sf.query( "SELECT Label, Description FROM EntityDefinition WHERE IsCustomizable=True")...
  • 149
1 vote
1 answer
812 views

Python Simple-Salesforce - Fetch Bulk API Job Id in result

Is there some way to get Bulk API Job Id in job results? object_type = self.sf_connection.bulk.__getattr__('Case') results = objecttype._bulk_operation(use_serial = True, operation = 'delete', data = ...
  • 178
1 vote
1 answer
225 views

With simple-salesforce how can i trigger case ownership email?

I am using simple-salesforce to assign a case to an agent from a Queue. If I do this via the application i have the check box that says "send email notification" as pictured below. How can ...
  • 143
3 votes
1 answer
486 views

Create custom field type picklist via tooling rest api - which meta information required?

I want to create a new custom field on a custom object on SalesForce. The custom field type shall be of type 'picklist' (non-global) with a predefined set of values. I want to use the Salesforce ...
  • 195
0 votes
1 answer
98 views

JSONDecodeError while accessing Salesforce's ContentNote content using simple-salesforce

I am trying to access the content from the contentnote object. I queried ContentDocumentLink where i passed account id as LinkedEntityId and got the ContentDocumentId. Using ContentDocumentId, I ...
  • 3
1 vote
1 answer
974 views

Dynamically Update and Insert Records using Simple-Salesforce Library

I am using the Python Simple-Salesforce Library for bulk insert and updating records. I want to create one method in which I pass the Sobject API name and then at run time have it insert/update ...
1 vote
1 answer
679 views

Python Simple-Salesforce - Import related records with an external ID

Some time ago I've started to use Python with Pandas and Simple-Salesforce to make data migration to Salesforce orgs. I want to insert Account records and Contact records that have lookup to Account ...
  • 121
0 votes
1 answer
150 views

How to upload products to opportunity using simple_salesforce

OK, I can be more specific now. Tried now to simply create new opportunity line items, however, I get this error message: esponse content: [{'message': "Error: You can't select products until you'...
1 vote
1 answer
540 views

Simple Salesforce Query issues involving Malformed requests

I have a malformed query problem when using simple salesforce for my AWS python Lambda. The query uses the AccountContactRelation object. When an event is dropped into an AWS S3 bucket for taxonomy ...
0 votes
0 answers
16 views

lightning:unsavedChanges not works with console application

lightning:unsavedChanges not works while doing tab switch in console application. It works fine on tab switching in standard application. Any thoughts?
  • 33
1 vote
1 answer
637 views

Python Simple Salesforce - Upsert to CampaignMembers Object

I am trying to find an automated way to add contacts & leads to existing campaigns by using simple salesforce to upsert records to the CampaignMembers object. I have a CSV file with CampaignId and ...
  • 23
0 votes
1 answer
199 views

Execute Anonymous via Simple_Salesforce throwing EOF exception

I'm attempting to execute a simple anonymous Apex script via Python with the simple_salesforce library. from simple_salesforce import Salesforce sf = Salesforce(instance=scratch_org_instance, ...
1 vote
1 answer
3k views

REST API: Error 'METHOD_NOT_ALLOWED' - PATCH

I am trying to upload new records by calling a REST API but am getting the following error. simple_salesforce.exceptions.SalesforceGeneralError: Error Code 405. Response content: [{'errorCode': '...
  • 23
2 votes
1 answer
1k views

Object of type datetime is not JSON serializable

I'm new using Simple_Salesforce for Python and I'm trying to update a record of "Account" and one of the values that I need to update is a Date/Time value, but I'm receiving the error: "...
0 votes
1 answer
73 views

Is there any way to cache the salesforce data using "simple_salesforce" python library

In my python application, I used "simple_salesforce" library to fetch data from salesforce. Instead of hitting an API every time I would expect salesforce to return data from cache instead ...
  • 101
2 votes
1 answer
3k views

Using simple-salesforce with oAuth

I have a need to query salesforce data through a django app. I am currently using simple-salesforce to do this on our QA salesforce using a username, password and a security token. Now that I am ...
  • 143
0 votes
1 answer
276 views

simple_salesforce python how to rewrite this using bind variables

revenue = sf.query("SELECT Id, Name, Net_Revenue__c, Price__c, Credits__c, Gross_Revenue__c, Account__r.Name \ FROM Revenue__c WHERE Account__r.Id = '"+accountId+"' and MonthYear__c ...
  • 15
1 vote
1 answer
1k views

Dynamic simple_salesforce query with list of ids

This 2nd format_soql is not working. I have tried replacing the single quotes to double quotes as per the format defined here: https://github.com/simple-salesforce/simple-salesforce#queries query1 = &...
  • 118
0 votes
1 answer
126 views

Where can I view attachments that I've uploaded to salesforce using a REST api?

response = requests.post('https://%s.salesforce.com/services/data/v29.0/sobjects/Attachment/' % instance, headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer %s' % sessionId },...
0 votes
1 answer
1k views

Error Salesforce data query - [{'message': 'INVALID_HEADER_TYPE', 'errorCode': 'INVALID_AUTH_HEADER'}]

I am trying the get data from Salesforce using simple_salesforce python package. But I am getting Response content: [{'message': 'INVALID_HEADER_TYPE', 'errorCode': 'INVALID_AUTH_HEADER'}] when I ...
  • 3
0 votes
1 answer
52 views

Is ActivityDate a known bug with bulk API loading tasks?

I've been fighting Salesforce all morning with a data load via the Python simple_salesforce package (so yes, the bug could be there, rather than there being an issue in the Bulk API). If I run this ...
  • 1,155
2 votes
1 answer
783 views

passing a variable in SOQL select statement with python and simple-salesforce

I am trying to pass a variable into SOQL statement, I am using simple_salesforce library. I only need to grab the data when CreateDate of the Opportunity is > than yesterday, yesterday's date is saved ...
0 votes
1 answer
921 views

Python with Simple Salesforce dynamic SOQL query issue: ERROR at Row:1:Column:98\nline 1:98 no viable alternative at character '\\'",

I have to retrieved data from a SOSL query using simple saleforce with no issues. This query will search for duplicate leads or contacts in Salesforce and then get the multiple records retrieved and ...
0 votes
1 answer
511 views

Download ContentVersion.VersionData in Python

I have the following Python code using simple_salesforce module: def get_email_template(sf, agreement_id): email_templates = sf.query(f""" SELECT VersionData, ...
0 votes
0 answers
223 views

simple_salesforce bulk insert - Duplicate Id error

I am using the Python package simple_salesforce to bulk insert instances of a custom object. The custom object has Account Id as a foreign key, which I am inserting during the bulk insert. I'm seeing ...
0 votes
1 answer
951 views

simple_salesforce - Cannot bulk insert more than 10 records at a time [closed]

I am using the simple_salesforce Python package. I tried bulk inserting 100 records using bulk.insert(), and did so without any errors. However, when I checked how many records were present after, ...
0 votes
1 answer
1k views

SalesForce Bulk API response to Pandas DataFrame [closed]

I'm a beginner with the Salesforce API and recently, I've been trying make bulk API requests and convert the response into a pandas DataFrame, however, the results I'm having a tough time with are ...
2 votes
1 answer
1k views

How to use simple salesforce (python library for salesforce) to add ShippingAddress field?

I have tried to upsert an account with ShippingAddress using simple salesforce However, I am getting the error: [{u'errorCode': u'JSON_PARSER_ERROR', u'message': u'Cannot deserialize instance of ...
  • 123
0 votes
0 answers
666 views

simple_salesforce Custom Domain

I am having some trouble using simple_salesforce to login using my username, password, security token. My companies SF instance is on a custom domain (I do not use login.salesforce.com and instead I ...
  • 113
1 vote
1 answer
2k views

simple_salesforce Run Report

I have a simple Salesforce report that returns basic information about some opportunities such as opportunity id, owner, end date. I found the simple_salesforce Python module and I am trying to ...
  • 113
2 votes
1 answer
2k views

Unable to fetch complete records from bulk query batch result

I am using simple-salesforce python library using REST to call bulk services which is working fine till calling but for large dataset library continuously poll the batch status and spit all result (in ...
  • 133
0 votes
1 answer
4k views

Getting error in Python when login to Salesforce

I am using simple-salesforce 0.74.2 for connecting to Salesforce by using below code, from simple_salesforce import Salesforce,SalesforceLogin sf = Salesforce(instance_url='https://xxxxx-xxx.my....
  • 61
2 votes
1 answer
1k views

How to Query for logged in username [Python:SimpleSalesforce]?

Tried to do user=sf.query("SELECT Id, Name FROM User WHERE Id = :UserInfo.getUserId()" but getting error: content = [{u'errorCode': u'MALFORMED_QUERY', u'message': u'\nSELECT Id, Name from User ...
  • 23
2 votes
1 answer
798 views

Salesforce Report - Column list

I am trying to see if I can fetch all columns in Reports object. I have the before import pandas as pd from simple_salesforce import Salesforce sf_data_cursor = Salesforce(username='mail@mail.com', ...
0 votes
1 answer
2k views

Python Simple Salesforce and salesforce rest authentication errors

An absolute python newbie & trying to establish a connection between python & salesforce. Followed this documentation - https://pypi.org/project/simple-salesforce/ and we have a python script ...
  • 3
0 votes
2 answers
895 views

Simple-Salesforce API object agnostic

Trying to figure out a way if I can use this API to get retrieve data if I only have the ID (don’t know if it is a task or a contact, etc.) I think no but just want to confirm.
1 vote
1 answer
1k views

REST Upload attachments - Json Deserialization failed on token 'null'

I'm using simple-salesforce to migrate attachments from one org to another. I'm encoding with base64 but am getting this error: SalesforceMalformedRequest: Malformed request https://my_org.my....