Skip to main content
Skip table of contents

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:

  1. From the App Launcher, enter and select Queries
  2. Select New
  3. FieldDescription
    Query NameThis 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'. Select System 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. Select User when creating a query where you want to enforce the sharing rules that apply to the current user. 

    SELECTEnter the fields you want returned by your query, separated by a comma (ie: name, id, date)
    SObjectThe 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. 

    ORDER BYEnter 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)

    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.

  4. Select Save

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.