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
37 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
49 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
40 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
179 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
34 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
1 vote
0 answers
86 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
79 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
  • 767
0 votes
0 answers
123 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
199 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
100 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
0 answers
80 views

Salesforce permissions not creating correctly using simple-salesforce

I am trying to create a permission set, object permissions for that permission set and field permissions for that permission set. However, the permission set is created correctly but the permissions ...
Paul Bradbury's user avatar
0 votes
1 answer
193 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
123 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
219 views

Selenium with Python - Testing Salesforce Oppurtunity - Not Working

I'm trying to Automate the basic click on Opportunity Tab Functionality on my Salesforce Page. Below is the code, import time from selenium import webdriver from selenium.webdriver.chrome.options ...
Sir Percy Blakeney'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
0 answers
85 views

How to decode validFor for dependent picklists in Python?

According to this question, validFor="AAAI"should translate to 000000 000000 000000 001000. With the following function I get 10000010100000101000001010010010 however. What is the problem? ...
Corram's user avatar
  • 123
0 votes
0 answers
165 views

I am not able to update records in my custom object using the api name Validate_Contact__c

I am not able to update records in the custom field Validate_LinkendIn_Title of my custom object Validate_Contact from the dataframe df_final. The error SalesforceResourceNotFound: Resource ...
Tejas 's user avatar
0 votes
2 answers
177 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
172 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
512 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 ...
Tyler Davis's user avatar
0 votes
1 answer
102 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
846 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. ...
Tyler Davis's user avatar
1 vote
1 answer
238 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
0 answers
62 views

SFMC SOAP API - Handling Rate Limiting - 500 Response

I am currently extracting all records from a DE that has close to 1 million subscribers in it. About half-way through I run into a 500 response after dozens of successful 200's. I believe it's due to ...
Carson W's user avatar
0 votes
1 answer
332 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
323 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
342 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
246 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
1 vote
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
212 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
5k 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
1 vote
1 answer
285 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
264 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
182 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
243 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
144 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
361 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
114 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
224 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
735 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
532 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
401 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
  • 450
1 vote
0 answers
552 views

Can you use a tkinter and/or virtual display with Heroku?

I am developing a Python app, using Django to create the website to access my scripts. The scripts open a tkinter window and I use PIL to take a screenshot. Then the screenshot is sent as an image to ...
ferzle's user avatar
  • 11
1 vote
1 answer
521 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 ...
jAC's user avatar
  • 143
3 votes
1 answer
1k 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 ...
HeXor's user avatar
  • 215
0 votes
0 answers
415 views

Triggered send not sending email

I am using Python Fuel-SDK. I get the following response from triggered send, but the email is not sent Send Status: True Code: HTTPStatus.OK Message: OK Result Count: 1 Results: [(...
Prim's user avatar
  • 63
1 vote
1 answer
2k 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 ...
Matthew Metros's user avatar

1
2 3 4 5