Execute SOQL Query
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
-
Object for SObjects (Output):
Specify the type of SObject that the query results should return.
-
soqlQuery (String):
Enter the SOQL query to be executed.
-
Offset (Integer):
Specify the offset for pagination in the query.
-
qrylimit (Integer):
Define the limit for the number of records to be returned.
Outputs
-
JSON Result:
A JSON string representing the query results.
-
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:
-
Flow Setup:
Create a Salesforce flow triggered by the administrator to start the report generation process.
-
Adding Execute SOQL Query Component:
Incorporate the Execute SOQL Query component into the flow.
-
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.
-
-
Executing the Query:
The flow runs the SOQL query, fetching the required data across multiple objects.
-
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.