Hi I am using a SOQL query to return a list of Contact ids. These ids are strings. Is there a way to use these ids to referece information on these contacts ids?

I think I need to use a sub query?

SELECT MyObject.Id, MyObject.name, MyObject.OtherContact, 
        (SELECT OtherContact.Name, MyObject.OtherContact.Telephone 
         FROM  MyObject.OtherContact 
         WHERE  OtherContact.Id = MyObject.OtherContact) 
FROM Object

Thanks Barry

1 Answer 1


I am not sure whether i understood your questions correctly. you can query the other fields of contact as you have list of contact ids:

Assumed that contact ids stored in a List listOFContactIds

List<Contact> listOfContacts = [Select Id, Name, Email from Contact where Id in : listOfContactIds]

Please refer this link for More Info


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .