SOQL Tasks
SOQL Tasks
This repository contains sample SOQL tasks that you can complete in Code Builder or VS Code using the Salesforce Extensions. We constantly add to this list, so make sure you visit this topic often.
Create a Query That Lists 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 file. 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 object, and 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
Trailhead – Write SOQL Queries