Reply
Regular Contributor
Arek S.
Posts: 16
0
Accepted Solution

Format of SOQL Query using IN clause

I'm sending a query to SalesForce (using the SOAP API) that includes an IN clause, however, I keep getting a MALFORMED_QUERY error.  Could someone point me in the right direction of what the query syntax is when using the IN clause?  I've tried the following without success (the ids are made up in these examples):

 

SELECT Id FROM Lead WHERE Id IN {'000000000000000','111111111111111'}

SELECT Id FROM Lead WHERE Id IN '0000000000000','111111111111111'

 

Thanks.

Moderator
SimonF
Posts: 7,980
0

Re: Format of SOQL Query using IN clause

You're close 

 

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

Cheers
Simon
docs | blog | twitter