Salesforce Fact #962 | SOQL syntax error in Get Records while using IN operator and sorting
We need to be careful while using the IN operator in Get Records element along with sorting of the result by a field. If the text collection is null which is used in the Id filter, the underlying SOQL throws a syntax error. As a best practice, it is always preferred to check if the collection var is null or not. This also avoids one SOQL query. Attached are the screenshots. Reference: https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000JfvwISAR