Wildcard
In Salesforce SOSL search and SOQL queries, special characters (* and ?) used as placeholders in search terms where * matches zero or more characters and ? matches exactly one character, broadening…
Definition
In Salesforce SOSL search and SOQL queries, special characters (* and ?) used as placeholders in search terms where * matches zero or more characters and ? matches exactly one character, broadening search results.
In plain English
“A Wildcard in Salesforce SOSL search and SOQL is a special character used as a placeholder in search terms. The asterisk (*) matches zero or more characters and the question mark (?) matches exactly one character, broadening your search results.”
Worked example
A support engineer at Finchgrove Travel searches Salesforce for customer Cases related to refund issues. He types "refund*" - the asterisk Wildcard matches "refund," "refunded," "refunding," "refunds." The search returns all variants in one result set. In SOQL queries, the same Wildcard works in LIKE clauses: WHERE Subject LIKE 'refund%' (the % is the SOQL wildcard, where * is the SOSL wildcard). The single-character ? Wildcard helps with typos: "col?r" matches "color" and "colour." Wildcards broaden search results when the exact spelling isn't known.
Why Wildcard matters
In Salesforce SOSL search and SOQL queries, Wildcards are special characters (* and ?) used as placeholders in search terms where * matches zero or more characters and ? matches exactly one character. They broaden search results by matching variations of a term.
Wildcards are useful when you know part of a term but not the exact spelling. Searching for 'Acm*' matches Acme, Acmed, Acmedata, etc. The ? wildcard is more precise: 'Sm?th' matches Smith and Smyth but not Smooth. Mature search users combine wildcards with other techniques for precise results.
How organizations use Wildcard
Trains users on wildcard search for finding records with partial terms.
Uses wildcards in SOSL for flexible record searching.
Teaches wildcard usage as part of search technique training.
Trust & references
Straight from the source - Salesforce's reference material on Wildcard.
- Wildcards in SOQL QueriesSalesforce Developers
Test your knowledge
Q1. What is a Wildcard?
Q2. What does * match?
Q3. What does ? match?
Discussion
Loading discussion…