Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs

Questions tagged [python]

Python is a widely used easy to learn programing language with which one can automate a lot of salesforce tasks by writing scripts. There are python packages like beatbox among others which are salesforce clients and support commands like SOQL queries, upsert, updating, and creating records in salesforce.

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

simple_salesforce bulk insert function causing a disconnect error

sf.bulk.object_name.insert(list_of_records,batch_size=100,use_serial=True) I'm using simple_salesforce to bulk insert records but once in a while it causes this error. ConnectionError: ('Connection ...
acs's user avatar
  • 1
0 votes
0 answers
60 views

simple_salesforce bulk query - timed out

I'm encountering timeout errors when fetching records from Salesforce via the simple_salesforce library and executing a SOQL query, particularly during bulk updates for a specific date. Currently, the ...
Prasath's user avatar
  • 11
0 votes
2 answers
42 views

Get PriceBook items details using Pricebook id in nested query

I have an sObject called Edition, it has the related PriceBook id, how to get the items of the PriceBook when querying the Edition details: What I tried: query = f""" ...
B. Mohammad's user avatar
0 votes
0 answers
42 views

Authorisation Error No CSFR Cookie Provided

I keep getting an error in the URL stating: https://companyname.my.salesforce.com/_nc_external/identity/sso/ui/AuthorizationError?ErrorCode=CSRF&ErrorDescription=No+CSRF+cookie&ProviderId=...
Shubham Sharan's user avatar
0 votes
1 answer
51 views

How to set a date field in salesforce to empty through salesforce bulk api from python

How can I use the Salesforce Bulk API from Python to set a date field in Salesforce to be empty/null for multiple records in a bulk operation? I have tried with following None - request accepted and ...
Vanjith's user avatar
  • 101
0 votes
1 answer
67 views

Bulk API to query all data too slow

I am trying to write a function in Python that can query all Salesforce Object data. I'm utilizing the salesforce_bulk Python Library. This is an overview of what I've written: def ...
aayushmishra_'s user avatar
0 votes
0 answers
40 views

Error when pulling contentversion data to create file in google drive using python

I am getting an error when trying to create a file in google drive using the salesforce contentversion data url for (index, row), (index2, row2) in zip(df2.iterrows(),df3.iterrows()): acid = ...
Pauline's user avatar
  • 375
0 votes
0 answers
89 views

All fuelsdk archives archived, any alternate way to query/load data extensions in Python?

About a week ago, all the FuelSDK archives were archived (under https://github.com/salesforce-marketingcloud). Question: Does anyone know of a forthcoming replacement? And is there an expectation the ...
Levin's user avatar
  • 101
0 votes
1 answer
32 views

Display contents of a Content Note on a Classic Task Email Template using Task WhoId (relatedTo)

I am trying to display the values of the Content Note object's content field that is related to a lead record and I want to display those values on a task email. Thanks. We use AWS Python Lambda ...
Anthony Williams's user avatar
0 votes
0 answers
24 views

SOC 2 Type 1 Report for Salesforce via Python

How can I download the SOC 2 Type 1 report from compliance.salesforce.com via Python API or SDK? Here is the report URL: https://compliance.salesforce.com/en/documents/a005A00000uKyHxQAK
Aman Chagti's user avatar
0 votes
0 answers
69 views

Uploading file using multi-part from python

Hello I am trying to upload file to contentversion via rest api tp salesforce using python. I keep getting an error. Can you please let me know how can I form my request so it adds the boundary string ...
PassionForDev's user avatar
0 votes
1 answer
58 views

Extended Response Time with simple_salesforce Library's upsert method

Problem Statement: I'm encountering prolonged response times exceeding 30 seconds while using the simple_salesforce library to perform upsert operations in batches using the bulk functionality. The ...
Mahesh Patil's user avatar
0 votes
0 answers
48 views

Best Practice to store Salesforce credentials outside Salesforce for Python Integration

At the moment, I'm using Python to integrate one of our databases into Salesforce using simple-salesforce package, and at the moment, all the Salesforce credentials are stored in the code itself. Is ...
jackson's user avatar
0 votes
1 answer
544 views

Retrieve a report using Python

I am trying to retrieve the report. The report URL looks like this https://space.lightning.force.com/lightning/r/Report/00000YTT000TTTY/view I have checked online and some suggested to change the ...
Saqib Sohail's user avatar
0 votes
1 answer
76 views

Get a mapping of External Ids and Salesforce Ids when migrating data from simple-salesforce

I want to migrate Account data into Salesforce and create a lookup table containing Salesforce IDs and External IDs. I am using the simple-salesforce library to perform a bulk insert of Accounts into ...
Aayush Mishra's user avatar
2 votes
0 answers
222 views

Error creating ActionCadence via Salesforce API

I'm looking to create an ActionCadence (Salesforce Cadence) using the object reference documentation. It states that in version 58, you should be able to "create()" Based on the error code I ...
Hunter Sneed's user avatar
0 votes
1 answer
197 views

How to Access File's VersionData via API Callout in Python

tl;dr - How can one access the returned data from a callout to a ContentVersion.VersionData field value (sObject blob) in Python? Background As a follow up to this question's reply, I currently have a ...
Jwok's user avatar
  • 769
0 votes
0 answers
334 views

Why is my SESSION_ID invalid immediately after authenticating my JWT token?

So I am trying to get simplesalesforce working in a dev account for proof of concept (and, so far, I've been making a proper mess of it). I have FINALLY managed to successfully connect using a JWT ...
jesse's user avatar
  • 121
2 votes
1 answer
410 views

How Do I Use OAuth2.0 With JWT To Connect To Salesforce?

So I'm trying to get a proof-of-concept together so I can ask my employer for access to our Salesforce (I'm a new employee and very low on the food chain, but their current workflow is just STUPID). I'...
jesse's user avatar
  • 121
0 votes
0 answers
156 views

Unable to retrieve the error records with error details from Salesforce using simple-salesforce

I am using the simple Salesforce Python library to load data from S3 to Salesforce using Databricks. I am leveraging the bulk API for the data load process. However, when attempting to insert data ...
SK ASIF ALI's user avatar
0 votes
1 answer
319 views

How to set field level security on new field with simple_salesforce

I'm working in Python with the simple_salesforce library. I can create new fields on my Account and Contact objects, based on info in How to update object description using simple_salesforce. ...
David Goldfarb's user avatar
1 vote
0 answers
171 views

Download a large Salesforce Report using Python simple_salesforce

I am trying to download a large Salesforce Report using Python that has around 300k rows. It seems that because the report is so big the code executes but does not populate the data. Is there a way to ...
Alexander Von Schwerdtner's user avatar
0 votes
0 answers
1k views

Error : 10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None

We are getting this error Error: - requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054,...
Ambarish Pandey's user avatar
0 votes
2 answers
190 views

Output of FuelSDK response to python dataframe

I've been tasked with using python to pull event data from marketing cloud into a SQL database. I can get a print output with getResponse = getBounceEvent.get(), then print(getResponse.results). But ...
lengthy_preamble's user avatar
0 votes
0 answers
214 views

Unable to add CustomField to CustomObject Python API Simple Salesforce

When trying to UPDATE CustomObject with newly added custom field, I get this error message: TestCustomObject__c.AccountNumber_NEW__c: (INVALID_CROSS_REFERENCE_KEY, In field: fullName - no CustomField ...
JanB94's user avatar
  • 11
0 votes
1 answer
712 views

Simple-Salesforce: is there a way to bulk insert data on a lookup field without an external ID?

I previously posted this question: Simple-salesforce: perform a bulk insert on a lookup field In that thread I got the documentation answer for how to perform an update based on an external ID. In the ...
frequent user's user avatar
0 votes
1 answer
131 views

Coding Language for creating App on Salesforce AppExchange

I know the coding languages Salesforce primarily uses are Apex and Javascript. I'm interested in creating a Salesforce App on Salesforce AppExchange. Is it possible to create said app using Python?
m0bb_d33p's user avatar
0 votes
1 answer
1k views

Simple-salesforce: perform a bulk insert on a lookup field

I am attempting to perform a bulk insert to a custom object in salesforce using the simple-salesforce library. I have a lookup field with a the api endpoint 'Account_Name__c', along with a few others. ...
frequent user's user avatar
1 vote
1 answer
314 views

Python-Salesforce edit permissions

Hello currently I am playing around python and simple salesforce library. I succesfully connect and get data sy SOQL query, but cannot find you the way how to update records/permissions. sf = ...
Alhanz's user avatar
  • 31
0 votes
1 answer
473 views

Modify ContactId on an Opportunity via API

Question Is it possible to modify ContactId field on an Opportunity? I get a field security error, but I did not find an option to change the security level of the field. Motivation I have records ...
icemtel's user avatar
  • 101
0 votes
0 answers
393 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(...
lengthy_preamble's user avatar
0 votes
0 answers
468 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':...
Perdue's user avatar
  • 121
0 votes
1 answer
300 views

Salesforce Marketing Cloud - SOAP API - Python - Usable Properties For Data Extension Object Type

Is there documentation outlining all usable fields to pass into your SOAP packet when retrieving information on the DataExtension Object Type? I thought the below link was outlining usable fields with ...
Carson W's user avatar
2 votes
1 answer
1k views

Python - Constructing SOAP Packet - Requests Library

Can anyone spot what may be incorrect in the below SOAP request? I am receiving a 400 response, "Bad Request", with the below SOAP request. After chatting with support and looking at ...
Carson W's user avatar
0 votes
1 answer
251 views

Problem with API Query Python

I am trying to create a query with python using a IN clause : def sf_api_call(action, parameters = {}, method = 'get', data = {}, keys = {}): # pylint: disable=dangerous-default-value ""&...
Van Jake's user avatar
0 votes
1 answer
7k views

Python: Object of type bytes is not JSON serializable

I am attempting to move ContentVersion records from one Salesforce org to another using the simple-salesforce python library. I am querying the VersionData and returning it in r.content here: import ...
Andrew Cann's user avatar
2 votes
2 answers
445 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 ...
Andrew Cann's user avatar
1 vote
0 answers
296 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=&...
JanB94's user avatar
  • 11
0 votes
0 answers
36 views

Response Code 400 on Authorisation Start with REST API python [duplicate]

I am trying to use python to wor with the SalesForce API, and I've created all of my API keys, connected app with all permissions and everything, but when I make an authorisation call, I get response ...
Tim T's user avatar
  • 13
0 votes
1 answer
240 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("...
Corram's user avatar
  • 123
-1 votes
1 answer
280 views

Create events in EventLogFile in Salesforce using python

I'm trying to create some fake events using python in Event Log File: from simple_salesforce import Salesforce, SalesforceLogin, SFType session_id, instance = SalesforceLogin(username=username, ...
user14073111's user avatar
0 votes
1 answer
6k 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 = '[email protected]', password = '...
KarSho's user avatar
  • 101
0 votes
2 answers
188 views

SOAP API request returns 405

I want to get SubscriberStatusEvent using: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/retrieving_the_subscriberstatusevent.html the following code returns OK but there is ...
DonnyDarko's user avatar
0 votes
1 answer
461 views

Unsubscribe reason retrieval

I am retrieving Subscriber attributes and data from the "All Subscribers" list. I am getting all data except 1: Unsubscribed Reason. Message: Error: The Request Property(s) UnsubscribeReason ...
DonnyDarko's user avatar
0 votes
1 answer
131 views

Retrieve all attributes of a subscriber using FUEL SDK PYTHON

I am trying to get all the attributes of a subscriber including some custom attributes. I know I can retrieve the attributes using: getSub = ET_Subscriber() getSub.auth_stub = myClient ...
DonnyDarko's user avatar
0 votes
1 answer
253 views

SOAP API access to SFMC doesn't work

I am following the README on FUEL SDK and trying to get access to SFMC via SOAP API. auth = SalesforceTokenProvider() access_token = auth.get_token() myClient = FuelSDK.ET_Client( ...
DonnyDarko's user avatar
0 votes
1 answer
962 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 ...
ThaNoob's user avatar
  • 149
2 votes
2 answers
622 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")...
ThaNoob's user avatar
  • 149
0 votes
1 answer
514 views

Check if an object has records using python

How can I check if an object has records using Python? I only know the object api name and label. I don't know its field names. The answer may be a boolean or a list of record ID's.
ThaNoob's user avatar
  • 149
1 vote
1 answer
2k 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 = ...
Sukruti's user avatar
  • 462

1
2 3 4 5