Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
25 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
17 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 ...
1
vote
1answer
49 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
17 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
30 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
29 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
109 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
18 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
17 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
26 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
40 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
31 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
61 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
29 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
49 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
25 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
87 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
48 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
138 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 ...
0
votes
0answers
21 views

Marketing Cloud SDKs, read Data Extention

Unable to connect to MC using Python FuelSDK, may related to mismatch between parameters in config.python and MC. Config.python defaultwsdl1: changed depending on the Salesforce marketing cloud ...
5
votes
1answer
203 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
59 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
41 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
82 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
54 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, ...
0
votes
1answer
90 views

Python FuelSDK for Python 2.7 version

I looked at the pypi documentation and it looks like SalesForce-FuelSDK for python supports Python 3.3 version. https://pypi.org/project/Salesforce-FuelSDK/ Has anyone figured out a way to get it ...
1
vote
1answer
71 views

Can you use Fuel SDK with Python for the object TriggeredSendSummary

I know you can use ET_TriggeredSendSummary() method with the Fuel SDK using PHP but does anyone know if you can use it with Python? I don't believe so. Furthermore, do you know when it will be ...
1
vote
2answers
187 views

Getting SF report information using SOQL

I have a SF report created in the Salesforce of type 'Contacts With Opportunities'. I need to set the ETL automation for this report using python.: Please have a look at following screenshot: I have ...
2
votes
1answer
166 views

Data Loader converting & to & and throwing error

I am trying to load a csv file (encoded as UTF-8) into the salesforce Data Loader. One of the values in the csv file is a string reading "Biotechnology & Science". When I try loading the csv file, ...
4
votes
1answer
708 views

Error “Bind variables only allowed in Apex code” simple_salesforce (Python)

Not sure if this belongs here or in StackOverflow, seems 50/50. I am trying to figure out how to build a dynamic query using simple_salesforce and there is no problem using a completely static query ...
2
votes
1answer
321 views

How to publish Platform Event from aiosfstream python library?

I'm trying to consume/publish Platform Events using aiosfstream python library. There is a publish() function but I always get an error response: aiocometd.exceptions.ServerError: ('Publish request ...
3
votes
1answer
297 views

Invalid Date Format for CloseDate with simple salesforce

I'm encountering some issues when attempting to create an opportunity using the python library simple salesforce. I've verified that CloseDate is a Date Type field. With the simple salesforce ...
0
votes
1answer
280 views

Error with the Python Fuel SDK

I am trying to return all the data extensions within my org, and within the same script return a list from all the columns by looping through the results of from step 1. Here is a sample of my code: ...
4
votes
2answers
868 views

Can I directly call an Apex method from Python without exposing an endpoint?

We have a Python test library that uses Simple Salesforce that we use to run tests on our code base. So far we have been using endpoints to trigger Apex methods from outside the org. As per the ...
1
vote
1answer
73 views

How can I call a Python Script (with params) running on AWS EC2 from Salesforce?

I have built a Python script on an Ubuntu EC2 instance (AWS). How can I use a callout (or URL) on Salesforce.com to kickoff that script in the easiest way possible - what I mean is, I do not want to ...
2
votes
1answer
647 views

Can't get Access Token

Per the documentation, I've created an "installed package" in the admin panel of SFMC, which provides me a clientId and clientSecret. I'm using the Python requests library to make the call from my ...
0
votes
1answer
84 views

help with json format for batch create prospects with pypardot in Python

I'm interested in creating multiple new prospects from a CSV file with the batch_create method for Prospects objects in the pypardot package in Python. The method calls for the prospect information (...
1
vote
1answer
145 views

Query Opportunity Type (e.g New Business) via API fails with Bind Variable

I am trying to get all won opportunities that are new business only for example. r = requests.get('{}/services/data/v41.0/query'.format(instance_url),params = {'q':'SELECT Name, Type from Opportunity ...
1
vote
2answers
735 views

Connect to WebSocket From Visualforce Page

Below is my code - <apex:page docType="html-5.0" showHeader="false" sidebar="false"> <html> <head> <script type="text/javascript" src="http://cs8.salesforce.com/...
0
votes
1answer
35 views

Trigger debugs when uploading data with python?

Is it possible to do get trigger debugs when uploading data with python? I haven't been able to find the debug logs whenever I upload the data with python bulk.
0
votes
1answer
18 views

What are the charges if I host my chatbot in apps exchange

I have build a chatbot on python, what would be the cost to host it on Salesforce Apps Exchange
0
votes
2answers
2k views

DEPRECATION: Uninstalling a distutils installed project (pyOpenSSL) has been deprecated error while installing simple_salesforce python library

I am trying to install the python library for salesforce. I am trying on mac in the terminal using command sudo pip install simple_salesforce but I get an error while installing this. The error: ...
0
votes
0answers
29 views

checking if an attachment already exist given custom object

I am using python code with the SalesforceBulkpy API to upload an image to a custom object. I want to make sure I only upload the image once so I thought on adding a check if an image exists before ...
0
votes
1answer
317 views

Update Lookup Relationship using Bulk API and CSV

I'm trying to perform an update on our users using Python's Salesforce Bulk interface. Each account has a User ID field (UserID__c, External ID, Unique Case Insensitive) and a Parent ID field (...
2
votes
1answer
376 views

How to return full report (>2000 rows) using rest api?

I am unable to fetch a full report using the Salesforce REST analytics API. As was posted on another question, I am using the following solution(python): reportFilter = { "reportMetadata": {"...
1
vote
1answer
714 views

JSON_PARSER_ERROR: Cannot deserialize instance of date from VALUE_STRING [duplicate]

I am trying to insert date from csv file into Salesforce (Sandbox for now). I have a csv file that has this format YYYY-MM-DD hh:mm:ss. Bottom is screenshot from a csv file. I tried inserting into ...
0
votes
1answer
553 views

CSV Date format for Salesforce Date (or Date Time)

I am trying to insert data from csv file into Salesforce (using Python file). Bottom is portion of Python script to fetch the data from csv file and into Salesforce database. for line in file: ...
0
votes
1answer
57 views

Python FuelSDK - feed a list to search_filter?

Is there a way to feed a list of values to an ET object search_filter so that it will match on any of the strings in the list? email_list = ['email1@gmail.com', 'email2@gmail.com', 'email3@gmail.com']...
1
vote
1answer
689 views

Login with Python SOAP client to Metadata API

I'm using Python zeep to use SOAP to interact with Salesforce's Metadata API. I'm attempting to start with the simplest thing possible, just log in and read a metadata object. from zeep import ...
1
vote
1answer
2k views

INVALID_LOGIN: Invalid username, password, security token; or user locked out

I am writing a Python script to insert data, and got following error. I am using Sandbox now. Traceback (most recent call last): File "/home/jdoe/Desktop/John/SurveyProjectDataIntegration/...