SOQL Tasks
SOQL Tasks
This is a repository of sample tasks using SOQL that you can complete in Code Builder or VS Code using the Salesforce Extensions. We’ll keep adding to this list, so make sure you visit this topic often.
Use the SOQL Query Editor Create a Query To List Accounts with a New York State Address
- From the Command Palette, run SFDX: Create Query in SOQL Builder to open SOQL Query Builder.
- Click File > Save to save the query. Make sure to retain the
.soql
file extension. - Click the Switch Between SOQL Builder and Text Editors icon () to reopen the SOQL Query Builder.
- In the
From
field, search for the object, and then select theAccount
object. - In
Fields
, selectName
,BillingState
, andBillingCountry
. - In the
Filter
field, selectAND
, and set:BillingCountry = USA
AND
BillingState = NY
- Click Run Query.
A Query Result tab pops up. You can then save the result in csv
or json
formats.
Resources
Guides:
Trailhead: