Using Salesforce Search Instead of a Query Using Mule 4

SOSL and SOQL

One of the most used actions when we work with Salesforce integrations is the use of queries. It allows us to pull information from any table and even perform some subqueries and pull relationship data. But, there’s one action we as developers don’t use very often (and sometimes we don’t even know this operation is available to us). I'm talking about Salesforce Object Search Language (SOSL).

What the Salesforce.com Developer Documentation Says

This section has been taken from the Salesforce docs, here.

Salesforce Primer: Searching With SOSL Queries

The Salesforce API offers two options for searching for records within Salesforce: SOQL, (Salesforce Object Query Language and SOSL) and SOSL (Salesforce Object Search Language), which are available in Salesforce’s REST API.

How do the two differ? Well, SOQL functions as their version of the SQL SELECT statement for Salesforce Objects (sObjects) and is utilized in their /query endpoint. SOSL, on the other hand, has a more flexible syntax and can also be used as a simple keyword search. We’ll be focusing on the latter in this post.