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
0answers
18 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
9 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
32 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
33 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
33 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
29 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
95 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
22 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
31 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
19 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
39 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
109 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
148 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
172 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
43 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
46 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
107 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
79 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
204 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
144 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
87 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
192 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
412 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
102 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
0answers
50 views

Problem creating email in specific folder using python FuelSDK

I'm trying to create an email using the Python FuelSDK package and I'm getting the following error: Post Status: False Code: HTTPStatus.OK Message: Error Result Count: 1 Results: [(CreateResult){ ...
0
votes
1answer
69 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
87 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
92 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
63 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
305 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
176 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
657 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
79 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 ...
0
votes
0answers
46 views

How to fetch “bulk data loads” from salesforce using python and store it in postgres table?

How to fetch the number of record processed and number of record failed in salesforce using python. After a Bulk API upsert, how can i inspect the batch to find the count of record I am using the ...
1
vote
0answers
160 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
428 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
407 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
259 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
567 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
217 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
83 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
370 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 ...
0
votes
1answer
173 views

SOQL Lookup failing to retrieve values

I have following query that I am trying to run: select X__Region__r.Name, Operating_Unit__c from X__Worker__c where (X__Worker_Status_Current_WA__c = 'Active') Where X__Region__c is a lookup to ...
1
vote
1answer
370 views

How to Query for logged in username [Python:SimpleSalesforce]?

Tried to do user=sf.query("SELECT Id, Name FROM User WHERE Id = :UserInfo.getUserId()" but getting error: content = [{u'errorCode': u'MALFORMED_QUERY', u'message': u'\nSELECT Id, Name from User ...
5
votes
1answer
436 views

SFDX + CI: Scratch org user only sometimes has Marketing User permission

I'm working on a project in Python, using simple_salesforce to talk to the Bulk and REST APIs. I'm testing this project via Salesforce DX, running in GitLab Pipelines. I've encountered an odd ...
0
votes
1answer
200 views

Best way to retrieve tracking event from marketing cloud ? [Python]

Using FUELSDK library, We recently implemented our sync pipeline to sync data from our side into Salesforce marketing cloud. Now, the next thing that we would like to do is to fetch all tracking ...
1
vote
1answer
100 views

Salesforce Report - Column list

I am trying to see if I can fetch all columns in Reports object. I have the before import pandas as pd from simple_salesforce import Salesforce sf_data_cursor = Salesforce(username='mail@mail.com', ...
0
votes
1answer
156 views

Is it possible to create a complex filter with additional operands in Python FUEL SDK?

I am able to create a somewhat complex filter in Python using FuelSDK from_filter = {'Property' : 'EventDate', 'SimpleOperator' : 'greaterThan', 'DateValue' : fromDate} to_filter = {'Property' : '...
1
vote
1answer
96 views

Flatten SOQL Subquery to return 1 row per ActivityHistory

I currently have this query: SELECT (SELECT CallDurationInSeconds, CallData__c, Closed_After_DueDate__c, Reminder_Date_Time_LEX__c, PrimaryWhoId, Current_User_Assigned__c, LastModifiedById, ...