Skip to main content
Version: 1

Execute SOQL Query

  • Category

    • Query

    • Data

    • Design

  • Flow Icon

Overview

The Execute SOQL Query component in Plinqx is a powerful tool designed to execute custom Salesforce Object Query Language (SOQL) queries within your flows. This component is particularly useful for running complex, nested queries and supports pagination with offset and limit parameters. It is important to note that these queries are executed under the current user's permissions.

Inputs

  1. Object for SObjects (Output):

    Specify the type of SObject that the query results should return.

  2. soqlQuery (String):

    Enter the SOQL query to be executed.

  3. Offset (Integer):

    Specify the offset for pagination in the query.

  4. qrylimit (Integer):

    Define the limit for the number of records to be returned.

Outputs

  1. JSON Result:

    A JSON string representing the query results.

  2. sObjects:

    A list of SObject records of the specified type, as per the query result.

Example Scenario - Custom Report Generation

Scenario Overview:

A Salesforce administrator needs to generate a custom report that combines data from multiple related objects, including Accounts, Contacts, and Opportunities. The report must include specific fields and meet certain criteria, with the results paginated for easier handling.

Implementation with Execute SOQL Query Component:

  1. Flow Setup:

    Create a Salesforce flow triggered by the administrator to start the report generation process.

  2. Adding Execute SOQL Query Component:

    Incorporate the Execute SOQL Query component into the flow.

  3. Configuring Inputs:

    • Set 'Object for SObjects' to Account as the primary object of the report.

    • Define 'soqlQuery' with a nested query that retrieves relevant fields from Accounts, Contacts, and Opportunities, applying necessary filters and joins.

    • Use 'Offset' and 'qrylimit' to paginate the results, allowing for manageable chunks of data to be processed and viewed.

  4. Executing the Query:

    The flow runs the SOQL query, fetching the required data across multiple objects.

  5. Processing Outputs:

    • The 'JSON Result' provides the query results in JSON format, which can be used for further processing or exporting.

    • The 'sObjects' output contains the list of Account records, which can be further utilized within the flow for report generation.

Results:

The implementation of the Execute SOQL Query component allows the administrator to efficiently generate a comprehensive, custom report. By leveraging complex SOQL queries within the flow, the component enables the extraction of precisely tailored data sets, showcasing the flexibility and power of Plinqx in handling advanced data retrieval scenarios.