Skip to main content
shikhat
February 4, 2025
Question

How to pass multiple values using IN operator in salesforce SOQL

  • February 4, 2025
  • 3 replies
  • 0 views

Hi team ,

In SFDC integration , we are using SOQL query in operation to fetch some data for a given financial id , need to understand how to write the query to fetch data for multiple values involved.

Current implementation - concat(Select shareclass_c from breakdown_c where financial_id= ' ''' ,ri !finId) ;

How to write above for fetching data for multiple financial id's involved , ri! finId will be of multiple type of string . Tried to replace above = with IN operator in where clause, it shows malformed SQL as integration error.

Thanks
 

3 replies

csteward
February 4, 2025

I'm not sure about your exact use case, but for example with the Query DB Service we can 'trick' it in this scenario by using something like INSTR().  Example with an Oracle query:

SELECT...WHERE INSTR(ac!EmployeeIDList, ',' || empID || ',') > 0

The Data Input for ac!EmployeeIDList is:

="," & joinarray(pv!employeeID, ",") & ","

April 1, 2025

Hi Shika 

Did you got the solution for the same

 I tried to replace = with IN operator and was getting the same  error

davidj137213
April 1, 2025