Skip to content
Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
All snippets
SOQL

SOQL: localised picklist values with toLabel()

Returns the translated label for a picklist instead of the raw API value. Useful when the running user has a non-English language set.

SELECT Id, Name, toLabel(StageName), Amount
FROM Opportunity
WHERE CloseDate = THIS_QUARTER
  AND IsClosed = false
ORDER BY Amount DESC NULLS LAST
LIMIT 50

Notes

  • toLabel() respects the user's language; useful for emails to multilingual customers.
  • Use NULLS LAST so empty Amount values do not surface above real numbers.

Share this snippet

Share on LinkedInShare on X

Related dictionary terms

More snippets