[SalesForce] SOQL query with Dataloader using List Literal in WHERE Clause

Is it possible to construct a SOQL query with a list literal in the WHERE clause? My use case is that the data loader cannot handle child relationships/subqueries needed for my search, but I can get the full list of IDs to export and would like to submit a query along the lines of

[Select Id, Name, ... from Account WHERE Id in ('Id1', 'Id2',... ) ]

Since this is the DataLoader, I can't just use a variable list either. Or does someone know an alternate way to export queried data?

Best Answer

If you cannot get an answer or the list in lengthy, What I have done in the past is:

  1. Create boolean Flag named ExtporData__c on the object
  2. Updated all accounts via data loader using CSV with ID and ExportData__c field that should be exported

then in the data loader for export I simply used EmportData__c = true in the where clause

Related Topic