1

I'm wondering if anyone knows how to format an IN query using either beatbox or simple salesforce. Example:

select id from lead where id in ('00Q3000000zLxkFEAS', '00Q3000000eODvUEAW')

In simple salesforce I have:

sf.get_sfcontacts_all(param="where Id in ({0})".format())

I have tried using a list, a tuple and a string in the format arg but keep getting a malformed request.

Any help, please?

davejagoda
  • 2,420
  • 1
  • 20
  • 27
Daniel Dow
  • 487
  • 1
  • 7
  • 20

1 Answers1

1

using Beatbox and python 2.7 you should not get a malformed query. find the below code used without any errors:

import beatbox

"salesforceusername and password"
username = 'xxx'
password = "xxx"
token    = 'xxx'

"""conenct and authenticate"""
svc = beatbox.PythonClient()
svc.login(username, password+token)

"""execut SOQL query"""
res = svc.query("select id from lead where id in ('00Q3000000zLxkFEAS', '00Q3000000eODvUEAW')")

"""prints results in console"""
print(res)
glls
  • 2,325
  • 1
  • 22
  • 39