Pages

Thursday, March 21, 2013

How to create report in Salesforce with double quote in filter


A user come to me today asking how to create a report on Account with Account Name contain " (double quote) ?
Hmmm... it seems easily, just type " in report filter criteria using CONTAIN. But, it will not work, since " is consider as string function.

Checking to Salesforce community? @SteveMo response me with excellent answer. Type ' + " + ' (read: without + sign), instead of using " or \" (escape sequence in SOQL).








But I realize, after the report save and open the report again, the value for filter '"' is gone.






Not sure if this Salesforce bug? But, I believe this is something Salesforce need to look into.

2 comments:

  1. I need to do exactly the same thing. Basically I am scan a field containing JSON data which of course includes double-quotes. Unfortunately even when I try it in the Query Editor by putting like like '%\"bob the builder%' it returns nothing as if it is not running at all.

    ReplyDelete
    Replies
    1. George, I just try SOQL below and it works with no issue.
      SELECT Id, Name FROM Contact WHERE LastName LIKE '%\"bob the builder%'
      See this screenshot for the result
      https://na3.salesforce.com/sfc/p/300000000SHq/a/50000000H0vV/sXvFUTZiGiTY1oWwNy7c2HDY.3qBd9HRumbFwpMxcK4=

      Delete