Integrations and APIs for Service

Get Involved. Join the Conversation.


    Iain McKay
    SOAP and ROQL: SELECT by Contact Email Address - How ?
    Topic posted September 14, 2010 by Iain McKaySilver Medal: 2,000+ Points, last edited October 29, 2011 
    8240 Views, 37 Comments
    SOAP and ROQL: SELECT by Contact Email Address - How ?



    While the following ROQL Query syntax in my C# app works:

    String queryString = "SELECT O.Contacts FROM Contact C WHERE Contact.Name.First = 'Iain' AND Contact.Name.Last='Mckay' ;";

    BUT, the following does not:

    String queryString = " SELECT Contact FROM Contact WHERE Contact.Emails[0].Address = '' ;";

    Any thoughts ? Am I not understanding the Contact Object model correctly ? As when I do a Writeline of the contacts, as returned in Query 1 above, then contact.Emails[0].Address works fine.



    Code Snippet:


    • bill.shipman

      Chris, what abotu using some kind of fuzzy logic to look up the contact? Name, Zip, and Street, for example. Or do you think that would fail for the same reason?

    • Chris Omland

      Hi Bill, you could possibly try that and it could work if the column you filter aginast is indexed.

    • Iain McKay

       Hi all (especially Chris),

      Just to confirm I am still having the same problem that kicked off this thread. We are still on Nov 2010.

      I have 'made do' with querying by 'login', but we have some RN contacts where the login is null. The Defalut email address is always set, so I would rather query for that. We get "RightNow enoucntered an unexpected internal problem".

      As I stated in the thread above, the data definitely IS there.

      Is this a defect with Nov 10 ?


      String queryString = " SELECT Contact FROM Contact WHERE Contact.Login = '"+ strTargetEmail.ToString().ToLower() +"' ;";


      //doesn't work

      String queryString = " SELECT Contact FROM Contact WHERE Contact.Emails.EmailList.Address = '" + strTargetEmail.ToString().ToLower() + "' ;";

    • Iain McKay

      Further info, using the apostrophe's in the ROQL expression throws the 'unexpected internal error' exception:

      String queryString = string.Format("SELECT Contact FROM Contact WHERE Contact.Emails.EmailList.Address = '{0}'", strTargetEmail.ToString().ToLower());

      Taking out the apostrophe's throws no exception, but fails to match.




    • Iain McKay

       Further clarification: this is on a Prod server and AUGUST 10, not Nov 10. Sorry.

    • Chris Omland

      This issue has been resolved by our development team and is slated for the April 04, 2011 service pack. You can find the service pack schedule here:


      Hope that helps.


    • bill.shipman

      I was able to confirm that there is a fix in Nov 2010 SP2. Thank you for resolving this.