Question

Salesforce SOQL filter on multiple fields OR statement

  • 9 December 2021
  • 4 replies
  • 1525 views

Hi - I’ve read a few topics around this issue and tried the solutions suggested, but I’m still getting nowhere. I’m trying to send only “closed won” opportunities from SF to slack and additionally filter the “TYPE” field for 2 values. My initial filter is on closed won deals (which is fine):

 

 

Then I’m trying to use the “Find Record by Query in Salesforce” option to further filter closed won deals by the “Type” field (standard field). This query doesn’t filter anything for me. Do I have this setup correctly?

 

 


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

4 replies

Userlevel 7
Badge +14

Hi @roman.kokoszka 

You may need to use the internal values (instead of friendly names) for each of those Salesforce Opportunity Type options, which may depend on the type of field the Type field is.

 

SOQL Reference: https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_conditionexpression.htm

 

Using the Find Object by Query Search

Tips for building a SOQL WHERE clause for your search:

  • Confirm all fields included in your query have appropriate field accessibility and are not ‘hidden’.
  • Fields names do not have to be wrapped with quotes.
  • Field values should usually be inside single quotes (e.g. 'John Doe').
  • The double quote character (") should typically be avoided.

WHERE clause examples:

  • Name = 'John Doe' AND Status = 'Active'
  • Where can be a mapped field from a previous step.
  • CreatedDate 2011-04-26T10:00:00:08:00
  • Name LIKE 'A%'

thanks for the response @Troy Tessalone - when you say “internal” values vs. friendly values, are you referring to the Value vs. API Name? In my query I’ve included in “’” the exact name (text) of what is displayed either as a SF value or API (they are the same in this case). The type field is not a record type field if that’s what you were hinting at.

 

 

Userlevel 7
Badge +14

@roman.kokoszka 

Can you confirm there are 1+ Opportunities that match these query criteria?

 

Otherwise, might be worth opening a ticket with Zapier Support for further assistance: https://zapier.com/app/get-help

Yes - we close multiple new deals each day/week matching this criteria. I’ll submit a ticket and post back here in case I find a resolution that might help others as I would think this would be a general need of many.

 

Thanks Troy.