Category: SOQL

  • How to Exclude Keywords in SOQL?

    Question I need to write a SOQL query in Power Automate that retrieves the IDs of Cases where the comment text does not contain specific keywords. Specifically, I want to exclude cases where the comment includes any of these words: “freigabe”, “Freigabe”, or “DocCheck_approved”. However, my current attempt does not work as expected. Instead of…

  • Efficient Pagination in SOQL Queries with the 2,000 Row OFFSET Limit

    Question What is the most efficient method to implement pagination in SOQL queries, considering the 2,000 row OFFSET limit? Answer In Salesforce Object Query Language (SOQL), the OFFSET clause allows you to skip a specified number of rows in the returned data, facilitating pagination. However, there’s a limitation: the maximum OFFSET value is 2,000 rows.…

  • Can LIKE Be Used with a List in SOQL?

    Question Is there a way to use the LIKE operator with a list of values in SOQL, similar to how we use IN? For example, can we write a query like this: Where nameList is a list of strings? Instead of dynamically constructing a query with multiple OR conditions, is there a more elegant way…