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
1 answer
24 views

Extract salesforce reports using API

I did some research, however I can't find anything related. Currently I need to extract some reports from salesforce, that take some time to do. I found out, that there is a python API that I can use ...
user avatar
0 votes
1 answer
47 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 = '...
user avatar
  • 101
0 votes
0 answers
20 views

"Application Error" After Successful Deployment

I successfully connected Heroku to my Github and deployed successfully but when I try to "view app" or "open app", it's returning an application error - saying my page "could ...
user avatar
0 votes
1 answer
26 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 ...
user avatar
0 votes
1 answer
32 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 ...
user avatar
0 votes
1 answer
16 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 ...
user avatar
0 votes
0 answers
21 views

FUEL SDK SOAP API INVALID CLIENT

I create an ET Client using FUEL SDK and pass in the parameters as follows: params = { "clientid": SALESFORCE_CLIENT_ID, "clientsecret": SALESFORCE_CLIENT_SECRET, ...
user avatar
0 votes
1 answer
34 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( ...
user avatar
0 votes
1 answer
65 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 ...
user avatar
  • 149
2 votes
2 answers
172 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")...
user avatar
  • 149
0 votes
1 answer
33 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.
user avatar
  • 149
1 vote
1 answer
183 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 = ...
user avatar
  • 178
1 vote
0 answers
191 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 ...
user avatar
  • 11
1 vote
1 answer
60 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 ...
user avatar
  • 143
3 votes
1 answer
153 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 ...
user avatar
  • 165
0 votes
0 answers
129 views

Temporary failure in name resolution error in Python app

I'm running a python app on Heroku EU region. Suddenly my app started getting an error. urllib.error.URLError: <urlopen error [Errno -3] Temporary failure in name resolution> I'm unable to ...
user avatar
0 votes
0 answers
101 views

Unable to deploy Python Module on Heroku bot

I've been trying to deploy my Discord bot but this error keeps popping up every time I try to build. I am using a modified version of the pafy module called apafy which only has a couple lines of code ...
user avatar
  • 1
0 votes
0 answers
95 views

Heroku Some Static Files Not Showing

I am having trouble getting heroku to show my images for my portfolio, I get a 404 error. My images are in a path called media/portfolio/images. What should I do? models.py from django.db import ...
user avatar
  • 1
0 votes
0 answers
63 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: [(...
user avatar
  • 51
1 vote
1 answer
335 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 ...
user avatar
1 vote
1 answer
371 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 ...
user avatar
  • 121
0 votes
1 answer
97 views

Merging Account Records Using SOAP With Python

I'm working on trying to merge a list of records in Salesforce via the SOAP API using Python. I am able to get a Postman POST request to work, but I am running into a roadblock with getting the SOAP ...
user avatar
  • 101
0 votes
0 answers
18 views

Rendered subject not appearing in sent event on python fuelsdk

I'm looking to pull the rendered subject from a sent event object as it's listed in the SFMC API docs https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/sentevent.htm. ...
user avatar
1 vote
0 answers
57 views

Fuel SDK | Python | rename data extension field name/attribute name

Is it possible to update the Field name of an existing data extension using Fuel SDK? My requirement: Change field name from 'Country' to 'Country_code' I was able to get the CustomerKey of required ...
user avatar
0 votes
1 answer
35 views

Merging Accounts on SOAP API While Preserving Data

I am working on some code right now to merge Accounts in Salesforce, but when I need to merge accounts I need to have certain fields preserved in case the victim account has something that needs to be ...
user avatar
  • 101
1 vote
1 answer
272 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 ...
user avatar
  • 111
0 votes
1 answer
182 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) ...
user avatar
1 vote
0 answers
47 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'...
user avatar
1 vote
1 answer
390 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 ...
user avatar
  • 23
0 votes
0 answers
61 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/...
user avatar
0 votes
1 answer
118 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, ...
user avatar
1 vote
0 answers
256 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 ...
user avatar
  • 155
1 vote
1 answer
2k 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': '...
user avatar
  • 23
1 vote
1 answer
140 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 = ...
user avatar
2 votes
1 answer
786 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: "...
user avatar
0 votes
1 answer
55 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 ...
user avatar
  • 101
0 votes
1 answer
95 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 ...
user avatar
0 votes
1 answer
283 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 ...
user avatar
0 votes
0 answers
50 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 ...
user avatar
  • 101
2 votes
1 answer
2k 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 ...
user avatar
  • 143
0 votes
1 answer
189 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 ...
user avatar
0 votes
1 answer
291 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 ...
user avatar
0 votes
1 answer
143 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> '...
user avatar
0 votes
1 answer
931 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 & ...
user avatar
  • 101
0 votes
1 answer
155 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 ...
user avatar
0 votes
0 answers
274 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 ...
user avatar
0 votes
1 answer
210 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 ...
user avatar
  • 15
1 vote
1 answer
953 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 = &...
user avatar
  • 118
0 votes
1 answer
119 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 ...
user avatar
1 vote
1 answer
157 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. ...
user avatar

1
2 3 4 5