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
1answer
25 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
35 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
46 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
26 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
26 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
25 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
49 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
42 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
62 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
27 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 ...
0
votes
0answers
10 views

Problem connection this server with my discord bot

So I run into this Problem every time I try to connect my discord bot with this Server. Can anybody help me?(Problem shown in the following screenshot)
3
votes
1answer
57 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
1k 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
45 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
50 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
33 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
186 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 ...
0
votes
0answers
24 views

Heroku 'log-runtime-metrics' will not Disable

I created a new application in order to host a discord music bot I created, however I keep getting a message like this message spammed in my logs every minute or so. heroku[worker.1]: source=worker.1 ...
1
vote
0answers
42 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
28 views

Create Activity and Automation through FuelSDK for Python

I was wondering if anyone has successfully been able to create Activity and Automation objects via Python FuelSDK. I can successfully start Automations but not sure what code to use to create an ...
0
votes
0answers
48 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
198 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, ...
1
vote
1answer
181 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 ...
0
votes
1answer
231 views

SalesForce Bulk API response to Pandas DataFrame [closed]

I'm a beginner with the Salesforce API and recently, I've been trying make bulk API requests and convert the response into a pandas DataFrame, however, the results I'm having a tough time with are ...
2
votes
1answer
49 views

Querying App Data in Salesforce with Python

Currently, we're switching over to Lightning and are wanting to analyze our sales rep's Lightning usage, building predictive models to determine how successful they will be if they switch over, etc. ...
1
vote
1answer
57 views

How to create Import Definition using FuelSDK Python

I'm able to create a new data extension and import few records using FuelSDK for python. However, I want to create a import definition and use that to import files from FTP site instead of manually ...
0
votes
2answers
114 views

Apex code to filter through python JSON file to Insert or Update Lead, Contact, Opportunity, PersonAccounts

I have a JSON loop-back file coming from Python that I need apex code to filter through the JSON and tell me the value of a field or if it is null so that it can then auto match whether a lead needs ...
0
votes
1answer
129 views

SSO authentication at API level

I am trying to automate a mobile application in my organization which uses SAML based SSO authentication to allow any user to login to the app. What I am trying to achieve is to perform an action in ...
1
vote
1answer
353 views

OAuth 2.0 JWT Bearer Token Flow - “error”:“unsupported_grant_type”

I am trying to use the OAuth 2.0 JWT Bearer Token Flow to get my access token for future api requests using Python 3.7 but I am receiving the following error: {"error":"unsupported_grant_type","...
0
votes
0answers
186 views

Getting change data capture events in Python

I am trying to figure out how to subscribe to streaming channel and get cdc events in Python, after success in creating new PushTopic and StreamingChannel. I saw some code examples in Java and NodeJS,...
0
votes
0answers
103 views

Why do not container upload to registry?

I read official heroku manual for deploy python-application via docker container: https://devcenter.heroku.com/articles/container-registry-and-runtime#getting-started I created app and going to step: ...
0
votes
1answer
284 views

Is it possible to get a return code from SFDX command executions?

I have a Python script where I run SFDX commands using subprocess module, here is part of my code: query = run(f'sfdx force:data:soql:query -u myOrg -q "SELECT Id FROM CronTrigger"', shell=True, ...
0
votes
0answers
564 views

Getting error while opening app in Heroku

I have deployed an application in python and django which is successfully deployed in Heroku. But when I am trying to open there it is showing error as below - After checking in logs it is showing ...
0
votes
1answer
117 views

FuelSDK-Python: Performing an EmailSendDefinition with a specific Data Extension

There is an old old thread about this and Salesforce hasn't being nice enough to extend their Python SDK (though the PHP and C# ones are way ahead). I can create the data extension but I'm not able ...
0
votes
1answer
110 views

Error when trying to send post request via python /composite/sobjects

Pretty much title says all, I was able to get the snippet within test = {} to work within salesforce workbench. Would love some guidance on what I am doing wrong as individual "non-bulk" requests work....
1
vote
1answer
157 views

How to use simple salesforce (python library for salesforce) to add ShippingAddress field?

I have tried to upsert an account with ShippingAddress using simple salesforce However, I am getting the error: [{u'errorCode': u'JSON_PARSER_ERROR', u'message': u'Cannot deserialize instance of ...
2
votes
1answer
113 views

Advice at debugging 500 response from FuelSDK.ET_Subscriber()

subscriber = FuelSDK.ET_Subscriber() subscriber.auth_stub = client subscriber.props = profile_attributes response = subscriber.post() When I log various attributes of the response object .code is ...
1
vote
0answers
74 views

How to add a Send Email Activity to an Automation with FuelSDK-Python?

I unable to associate an Email Send Activity when creating an automation in Fuel-SDK Python. Below is my props dictionary setup. When posted the Automation is created but there is no Send Email ...
0
votes
1answer
384 views

Using Python and simple salesforce with parameters “Bind variables only allowed in Apex code”

dict = sf.query("SELECT Id,FirstName,LastName,Email FROM Contact WHERE Id=:cid") cid is a variable defined by myself. I wonder how to use the simple query function to select the field. Any response ...
3
votes
0answers
211 views

How to insert records into an SObject using python beatbox module?

I am looking through beatbox's github repo here https://github.com/superfell/Beatbox/blob/master/beatbox/_beatbox.py#L122 And I am not sure whether I am using it correctly, specifically I am not sure ...
0
votes
3answers
827 views

FuelSDK Endpoints Clarification

I can authenticate the REST API through Postman, but I've tried both the python FuelSDK and C# SDK but I can't seem to get either of them to connect to my instance of Marketing Cloud. I think I'm just ...
1
vote
1answer
101 views

Open Html file from Heroku Bash

I have deployed my Flask python application on Heroku. The problem is that in one line of my python code I must open an HTML file (where some javascript gets executed). Obviously, it locally works in ...
1
vote
0answers
217 views

Python-driven Bulk API 2.0 hardDelete yields “errorMessage”: “InvalidBatch : InvalidBatch : The 'delete' batch must contain only ids”

I am trying to write a bit of python code to permanently delete some records using the Salesforce.com Bulk API v2. Using curl, I have success. I: create an Bulk API 2 hardDelete job PUT the file to ....
0
votes
1answer
631 views

simple_salesforce Run Report

I have a simple Salesforce report that returns basic information about some opportunities such as opportunity id, owner, end date. I found the simple_salesforce Python module and I am trying to ...
2
votes
1answer
544 views

Unable to fetch complete records from bulk query batch result

I am using simple-salesforce python library using REST to call bulk services which is working fine till calling but for large dataset library continuously poll the batch status and spit all result (in ...
0
votes
2answers
331 views

Call Salesforce API Rest with python

I'm try to call a REST web-service I made on Salesforce from a Python script @RestResource(urlMapping='/test_rest_api') global with sharing class Test_RestAPI { @HttpPost global static void ...
0
votes
1answer
827 views

Getting error in Python when login to Salesforce

I am using simple-salesforce 0.74.2 for connecting to Salesforce by using below code, from simple_salesforce import Salesforce,SalesforceLogin sf = Salesforce(instance_url='https://xxxxx-xxx.my....
1
vote
2answers
279 views

How to use serverUrl from salesforce login request in subsequent calls

I am working on a application where I need to use salesforce data replication api to get deleted/updated record id but this facility is available through SOAP api and examples are provided in java/c#. ...
1
vote
0answers
100 views

Marketing Cloud Fuel SDK API : get DataExtension/List related to Email, get Contact info from those DataExtension/List

I am working on Salesforce Marketing Cloud API to extract Email Receiver Contact detail. For that I used below approach. Step 1 : Extract List related to Email (used ET_ListSend()) using below code....
1
vote
1answer
430 views

DateTime values in Bulk Query results - difference between CSV and JSON formats

I'm running Bulk API queries in Python, using both the simple_salesforce and salesforce_bulk libraries. I've encountered a confusing result when querying DateTime fields. Given a simple_salesforce ...