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
29 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': '...
0
votes
1answer
21 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
13 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
148 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
24 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
16 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
30 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
28 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
40 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
2answers
35 views

Query Salesforce data with Python

I am quering Salesforce data with Python using simple_salesforce. I got Org Id from company profile. Can you suggest what I am doing wrong? Code: from simple_salesforce import Salesforce sf = ...
0
votes
1answer
84 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
24 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
22 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
52 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
49 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
137 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
49 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
112 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
58 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 ...
0
votes
1answer
174 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
25 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
81 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
19 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
10 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
42 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
147 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
211 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
85 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
19 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
95 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
240 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 ...
0
votes
1answer
343 views

Upserting records via Simple_Salesforce API on a field with Master-Detail relationship

I'm trying to use Python's simple_salesforce library to upsert on an object called Member Plan that has a required field called MemberId which is a Master-Detail relationship with the Account object. ...
-2
votes
1answer
337 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
61 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
317 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
296 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
191 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
75 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
250 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
47 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
263 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
67 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
91 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 ...
0
votes
1answer
50 views

Building Salesforce Applications using the Salesforce API

I am creating a salesforce deduping application using python. The issue I am running into is that deduping applications literally take hours to run through large databases. How do others execute ...
2
votes
0answers
470 views

How to resolve Heroku build error specific to Python 3.8.0

I'm deploying a Python (flask) app to Heroku via the commandline, and after specifying Python 3.8.0 in the runtime I got an error relating to '_ast27' extension I'm not sure what to do with. If I ...
1
vote
0answers
80 views

How can I use Salesforce SOAP APIs to pull the org name for an org subscribing to my managed package?

Background: I threw together a quick script to pull AppAnalytics logs from my LMA programmatically via python. This part is working just fine. I am including my script here in case it helps someone ...
0
votes
0answers
95 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
1answer
562 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, ...
2
votes
1answer
375 views

Salesforce as identity provider - implementing Single Logout (django + pysaml2)

Related question: https://stackoverflow.com/questions/47293940/sp-initiated-single-logout-not-working-with-salesforce I'm implementing single-sign-on service using Salesforce as identity provider. My ...