We changed our privacy policy. Read more.

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
1
vote
1answer
22 views

Django Heroku: remaining connection slots are reserved for non-replication superuser connections

I recently deployed an app to Heroku using Postgres free tier as database. I am using Django 3.2 Everything was working fine until I started getting a mail with the following error: Internal Server ...
0
votes
1answer
36 views

How to read version data in Salesforce

From Salesforce File, I want read the file and get the content between some text and store it in the Custom object record field. For this i have created external API(python script deployed to heroku) ...
1
vote
0answers
15 views

Invalid state when logging into connected python web app

I am having trouble setting up Salesforce as an auth provider for my Django application using Django Allauth, getting "No_Oauth_State: State was not valid" whenever I try to log in. What I'...
1
vote
1answer
131 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 ...
0
votes
0answers
41 views

Create Apex Trigger / Class using Python [duplicate]

I am trying to automate a few things for Salesforce using Python. I am using OAuth for Rest API for other processes like creating or updating records. I need to figure out how to create Apex Trigger/...
0
votes
1answer
50 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, ...
0
votes
0answers
35 views

FilterPart in Python Zeep

I am trying to extract data using Python Zeep module from SF DataExtention.Can anyone please help me to write the correct dictionary for Filterpart of Retrieve request. I am trying to pass the ...
0
votes
0answers
76 views

BulkAPI v2 with python fails while the same request with postman works fine

I am trying to get some query results using bulk api from Python. I have been able to get the token but I run into an error when I try to create the batch job based on documentation but I run into ...
1
vote
1answer
529 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': '...
1
vote
1answer
61 views

OAuth2.0 JWT bearer token flow with alg HS256 issue

I have written the below python code for JWT integration: from datetime import datetime import jwt import time import requests # *** Update these values to match your configuration *** IS_SANDBOX = ...
0
votes
0answers
58 views

Dash/Flask python app returning R15 out of memory error at 100% of the free dyno memory

Since 3 days ago, my dash app is crashing with R15 out of memory error, after reaching 512 MB memory usage (100% of free dyno). It was running for several months without any issues at 180%, and ...
2
votes
1answer
516 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
1answer
32 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 ...
0
votes
0answers
37 views

Salesforce API totalSize does not always match to the number of rows returned

I am downloading data from salesforce API. The table is big and I am using query_more to get full result. The problem is totalSize returned in result does not always match to the actual number of ...
0
votes
1answer
45 views

Encoding problems from Python to Salesforce

we are working with a third-party CPQ tool. A lot of information between both systems are transferred via Python. IronPython 2.7.5 is the used Python version. In one part of the script I´m creating ...
0
votes
1answer
39 views

Working with Python on Salesforce

Sorry guys I have to update my question to give more clarity on my thoughts/doubts I did research from official documentation from salesforce but didn't quite get anything useful. I am curious to know ...
0
votes
0answers
44 views

What is the best way to do Automation?

I'm running into issues with Cypressio and Selenium, and I'm pretty new to automation testing within Salesforce. What is the best thing to do? How to do it? & what are the tools that you recommend ...
0
votes
1answer
633 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 ...
0
votes
1answer
78 views

Combine multiple select statements in SOQL and python

I am trying to combine three columns(same data type) from three tables. I am receiving a malformed request error that I can't quite figure out. Initially I tried a UNION ALL but I learned that SOQL ...
0
votes
0answers
25 views

Adjust a custom report's data range using Python

I'm trying to find a way to adjust the date ranges in a Custom Report. I've been using simple_salesforce for all my other needs but for this i'm out of my element. I tried to simply adjust the end ...
0
votes
1answer
128 views

Is there a Python library that allows you to merge duplicate accounts in salesforce? [closed]

I would like to merge 10000 accounts who already have a master account assigned to them. This was done on an Excel file manually. I usually use the simple-salesforce API to update SF records, however ...
0
votes
1answer
65 views

SFMC API Integration using Python

Getting the following error when trying to integrate SFMC using Python. Can someone help me with this? File "/Users/abhinavagrawal/Desktop/sfmc_new.py", line 17, in <module> '...
0
votes
1answer
355 views

Consolidated Answer: How to extract a SF report using Python [closed]

I've been searching around the site for the past week or two and there seem to be a lot of opinions and ideas on how to download a report into a DataFrame from SF using Python (simple-salesforce & ...
0
votes
1answer
81 views

How to get a record with all data associated with it using Python?

I need a bit of direction I am looking for a way to acquire all the data associated with a client/lead/record inside Salesforce. I have looked all over the place, and most tutorials only talk about ...
0
votes
0answers
173 views

Would anyone be able to share an example of pk_chunking working using the python bulk api

I’m new to python and Sales Force. I have a bulk api extract job working and would like to add pk_chunking. I use the python library: from salesforce_bulk import SalesforceBulk Adding pk_chunking ...
0
votes
1answer
105 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 ...
1
vote
1answer
430 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 = &...
0
votes
1answer
49 views

Need Post Request format for Live app Insertion in quip via API

Is there an Example for insertion live app into Quip document via API Edit API Content-Type: application/x-www-form-urlencoded Authorization: Bearer {{access_token}} User-Agent: PostmanRuntime/7.26.7 ...
1
vote
1answer
92 views

Salesforce to Salesforce Migration

We are doing Salesforce (old instance) to Salesforce (new instance) migration. We have Standard and custom objects in our old instance which are needed to be migrated to the new Salesforce instance. ...
0
votes
0answers
20 views

Retrieve artifacts that are not translated

I have a managed package, from the past few releases we introduced new fields and custom labels, and other metadata but did not account for translations for those artifacts. How can I retrieve a list ...
0
votes
0answers
13 views

Fuel SDK Python scope mismatch [duplicate]

I'm trying to use the Marketing Cloud FuelSDK with Python to retrieve data extensions. However, I'm getting this error regarding scopes, no matter what I seem to do. I created a server-to-server API ...
0
votes
0answers
58 views

Can't download data from _MobileSubscription table using FuelSDK and python

I've set up FuelSdk on my airflow machine and I want to download some data from the _MobileSubscription table. but when I have a column starting with underscrore I'm getting this message Failed to get ...
2
votes
1answer
267 views

How to upload BLOB using the Quip API

Is it possible to upload an audio file using the Quip API? I see in the documentation the API supports the upload of blob objects. I can't seem to get this to work properly. I have tried uploading ...
0
votes
1answer
425 views

Can we use Node.js in Marketing Cloudpages?

We are planning to make Web scrapping tool in cloud pages using node.js . I want to know can we use node.js libraries and function in cloudpages ? We have a Url of a web page as input .Request {Url} ...
0
votes
1answer
171 views

Setting picklist values - salesforce python api

I am using the salesforce API and struggling to figure out when (and how best?) to set picklist values for different fields. Here is a code example: from simple_salesforce import Salesforce, ...
0
votes
0answers
20 views

I want to access Notes from Salesforce I am getting the response in from of url how to get my actual data from it? [duplicate]

SOQL QUERY -cn = "SELECT Title,Content FROM ContentNote" OUTPUT OF Content:/services/data/v42.0/sobjects/ContentNote/0692x000000WFDAAA4/Content
0
votes
1answer
155 views

How to get my actual data from ContentNote API in Salesforce using SOQL?

My Notes has Title-Task2 and Content is "Talk to customers" When I run following query: SELECT Title,Content FROM ContentNote Output is: ('Title', 'Task2'), ('Content','/services/data/v42.0/...
0
votes
1answer
424 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 ...
-2
votes
1answer
519 views

Execute python script through Apex class [closed]

I have a custom button in Salesforce and a python script which takes the data from Accounts table, perform some logic and save it in an object I want to execute python script by clicking the custom ...
0
votes
1answer
80 views

python SDK getMoreResults() doesn't retrieve any result

I am retrieving some DE rows that for sure have more results. The code: client = FuelSdkClient(clientId) #FuelSdkClient is a def where I am instantiating a client through a specific account row = ...
1
vote
1answer
460 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
1answer
442 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
1answer
246 views

Python: ContentVersion.VersionData throwing Incorrect padding while decoding to base64 string

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

extract data from the child BU

I have several BUs that are children of a sabe BU. I am trying to extract data with the python FuelSDK by creating a client id and a client secret. The thing is that I can only extract data from the ...
2
votes
0answers
347 views

How to find Unused methods in Apex Class?

I am aware there are couple questions already been asked for this use case and I went through Andrew Fawcett blog post having tool as a canvas app Spring Cleaning Apex Code with the Tooling API I am ...
1
vote
0answers
63 views

Getting associated email info using job/send id

I'm using Python and the associated Fuel SDK package to make API calls to SalesForce Marketing Cloud. I'm attempting to consolidate information from various cloud objects to obtain the same ...
3
votes
1answer
370 views

SalesforceBulk with pk_chunking Not working

I am trying to use pk_chunking for query large datasets. It's failing with below error from salesforce_bulk.util import IteratorBytesIO from salesforce_bulk import SalesforceBulk import json import ...
7
votes
3answers
3k views

Supported Programming Languages in Salesforce

I'm beginner in Salesforce and I have read that the Apex Programming Languages can be used in Salesforce. My Questions is : Can other Programming Languages like Python in Salesforce used ?
1
vote
0answers
83 views

Adding parameters to SOAP API call from SF by changing WSDL

I am working on an application using zeep and wsdl to call a SOAP api. The wsdl has a function that is pulling ~15 fields from salesforce, which are later written to a csv file (through python). I ...
0
votes
1answer
101 views

Using Python as backend to Salesforce App

Python has some amazing libraries that I want to take advantage of. The only issue that I am concerned about here are the governor limits for long running operations. I am creating a deduping app and ...