0
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 will be helpful!

3

you have to explicitly send a String of the query to SOQL from python, replace variable binding with concrete values and concatenations of string

ict = sf.query("SELECT Id,FirstName,LastName,Email FROM Contact WHERE Id='" + cid + "'")

This is exactly the same, as Dynamic SOQL in Apex

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.