Create a SOQL Query from Staff View
SOQL stands for Salesforce Object Query Language. It is used to read (query) information stored in your org. SOQL queries are the basis of data sources and are used to determine what records are returned.
Creating SOQL Query using Queries Service
You can create a SOQL query using Custom Metadata Types or by using the Queries (NU__Query__c) tab in Nimble AMS. Staff does not need administrator rights to create a query using the Queries tab.
To create a SOQL query using the tab, follow the below steps:
- From the App Launcher, enter and select Queries .
- Select New
Field Description Query Name This is the name for your query. It is recommended to use an easily recognizable name to identify the query. Sharing Mode Sharing mode controls the limits that the query will be executed with.
Select
System
to execute a query 'without sharing'. SelectSystem
when creating a query where you do not want the sharing rules for the current user to apply.Select
User
to execute a query 'with sharing', which applies user permissions for access. SelectUser
when creating a query where you want to enforce the sharing rules that apply to the current user.SELECT Enter the fields you want returned by your query, separated by a comma (ie: name, id, date) SObject The name of the object from which you want the fields to be queried WHERE (Optional). Enter the conditions that must be met in order for records to be returned by your query If you have multiple Community Hubs, keep in mind whether the SOQL query should filter for only records associated with the entity(s) for the Community Hub in which this SOQL query will be used, or if you want to return records from all entities. To return only records for the current entity, include SObjectEntityField = {!CurrentEntityId}
in the WHERE clause.Entity field name
In the above example, SObjectEntityField is the placeholder name. In actual query you have to replace it with actual field name which can vary.
Field Description ORDER BY Enter the field you would like the resulting records to be ordered by followed by ASC (ascending) or DESC (descending). (ie. " name ASC " will return your records in ascending order by name) LIMIT Enter the number maximum number of records to be returned by your query.
LIMIT
is set by default to 50,000, which is the maximum number of results Salesforce will return to a query. It's recommended that you set the value to 50,000 or below, since there will be an error if more than 50,000 results are found.- Select Save