Salesforce Tool
The Salesforce Tool lets you run SOQL queries against your Salesforce database directly from the Nappai dashboard. It returns the query results as data that can be used in other components or as a tool for further processing.
How it Works
When you enter a SOQL query in the Query to execute field, the component connects to Salesforce using the credentials you have configured in Nappai. It sends the query to Salesforce’s REST API, receives the results, and converts each record into a Data
object that can be passed to other components. The component also builds a reusable tool that can be used in automated pipelines.
Inputs
Before using the component, make sure you have created a Salesforce Rest API credential in the Nappai Credentials section. Then select that credential in the Credential field of this component.
Input Fields
- Query to execute: Enter the SOQL query you want to run. For example,
SELECT Id, Name FROM Account LIMIT 10
. This query will be sent to Salesforce and the results will be returned as data.
Outputs
- Data (method:
run_query
): A list ofData
objects, each representing a record returned by your SOQL query. This output can be fed into other components that accept data. - Tool (method:
build_tool
): ABaseTool
instance that can be used in Nappai pipelines to run SOQL queries programmatically.
Usage Example
-
Create a Salesforce credential
In the Nappai Credentials page, add a new credential of type Salesforce Rest API and fill in your Salesforce username, password, security token, and security domain. -
Add the Salesforce Tool component
Drag the Salesforce Tool onto your workflow canvas. -
Configure the component
- Select the credential you created in the Credential field.
- In Query to execute, type:
SELECT Id, Name, Industry FROM Account WHERE Industry = 'Technology' LIMIT 5
- Leave the other fields empty (they are handled by the credential).
-
Run the workflow
The component will return a list of accounts in the Data output. You can connect this output to a table component to display the results or to a filter component to process them further.
Related Components
- SalesforceSOQLTool – A lower‑level tool that can be used directly in custom pipelines.
- Data Table – Displays data objects in a tabular format.
- Filter – Allows you to filter data based on conditions.
Tips and Best Practices
- Test queries in Salesforce first: Run your SOQL query in the Salesforce Developer Console to ensure it returns the expected results before adding it to Nappai.
- Use limits: Always include a
LIMIT
clause in your queries to avoid pulling too much data at once. - Handle pagination: If you need more than 2000 records, consider using the
queryMore
method in the Salesforce API or split your query into smaller batches. - Secure your credentials: Store credentials in Nappai’s secure credential store and never hard‑code them in your workflow.
Security Considerations
- Credentials are stored securely in Nappai’s credential store and are never exposed in the workflow UI.
- The component uses HTTPS to communicate with Salesforce, ensuring that query data and credentials are encrypted in transit.
- Make sure to restrict access to the credential to only users who need to run Salesforce queries.