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
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
27 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 ...
1
vote
0answers
35 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
47 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
23 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
18 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
34 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
82 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
111 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
86 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
39 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
102 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
88 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
105 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
57 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
112 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
30 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
11 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
103 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
2k 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
53 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
57 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
37 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
308 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
26 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
56 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
60 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
316 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
242 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
325 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
69 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
76 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
127 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
198 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
509 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
1answer
388 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
609 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
126 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
149 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
245 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
132 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
82 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
484 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
232 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
980 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
117 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
291 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
882 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
672 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
403 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 ...