Fetch one from ext. database
Function: Fetch one from ext. database
This action allows you to retrieve a single record from an external database. You can specify which database to connect to, which table to query, and apply filters to find the exact record you need. This is useful for looking up specific information, like a customer's details, a product's price, or an employee's contact information, directly from your external data sources.
Input
- Database Connection: Details required to connect to your external database.
- Type: Choose between "MSSQL" or "MYSQL" depending on your database system.
- Server: The address or hostname of your database server.
- Database: The name of the specific database you want to access.
- User: The username for logging into the database.
- Password: The password for the database user.
- Port: The port number used to connect to the database (e.g., 3306 for MySQL, 1433 for MSSQL).
- Table: The name of the table within the database from which you want to fetch a record.
- Data Format: A blueprint or schema that defines the structure of the data you expect to retrieve from the table. This helps the platform understand the types of information (e.g., text, numbers, dates) in your record.
- Filters: (Optional) Conditions to narrow down which record to fetch. You can add multiple filters.
- Attribute: Select a column from your table (defined by your Data Format).
- Operator: Choose how the attribute should be compared (e.g., "Equal", "Greater than", "Contains").
- Value: The specific value to compare against the chosen attribute.
- Attributes to Fetch: (Optional) Specify which specific columns (attributes) you want to retrieve from the record. If left empty, all columns will be fetched.
Output
- Result: The single record found in the external database that matches your criteria. This record will be structured according to the "Data Format" you provided. If no record is found, this output will be empty.
Execution Flow
Real-Life Examples
Example 1: Fetching a specific customer's details
Imagine you have a customer management system and you need to quickly pull up a customer's full profile from an external database when their ID is known.
- Inputs:
- Database Connection:
- Type:
MYSQL - Server:
my-customer-db.example.com - Database:
customers_prod - User:
app_user - Password:
secure_password123 - Port:
3306
- Type:
- Table:
CustomerProfiles - Data Format:
CustomerProfileSchema(defines fields like CustomerID, Name, Email, Address) - Filters:
- Attribute:
CustomerID - Operator:
Equal - Value:
CUST-00123
- Attribute:
- Attributes to Fetch: (Leave empty to fetch all attributes)
- Database Connection:
- Result: The system retrieves the complete customer profile for
CUST-00123(including their name, email, and address) and makes it available asResult.
Example 2: Finding a product's price and stock level
You're building an e-commerce application and need to display the current price and stock for a product when a user views its page.
- Inputs:
- Database Connection:
- Type:
MSSQL - Server:
product-inventory.internal.net - Database:
InventoryDB - User:
inventory_reader - Password:
product_pass - Port:
1433
- Type:
- Table:
Products - Data Format:
ProductSchema(defines fields like ProductID, Name, Price, StockLevel) - Filters:
- Attribute:
ProductName - Operator:
Equal - Value:
Wireless Headphones Pro
- Attribute:
- Attributes to Fetch:
Price,StockLevel
- Database Connection:
- Result: The system retrieves only the
PriceandStockLevelfor "Wireless Headphones Pro" and makes this partial record available asResult.
Example 3: Verifying an employee's department by email
In an internal tool, you might need to check which department an employee belongs to based on their email address.
- Inputs:
- Database Connection:
- Type:
MYSQL - Server:
hr-data.company.com - Database:
HR_System - User:
hr_app - Password:
hr_secure_pass - Port:
3306
- Type:
- Table:
Employees - Data Format:
EmployeeSchema(defines fields like EmployeeID, Email, Department) - Filters:
- Attribute:
Email - Operator:
Equal - Value:
[email protected]
- Attribute:
- Attributes to Fetch:
Department
- Database Connection:
- Result: The system retrieves the
Departmentfor the employee with email[email protected](e.g., "Marketing") and makes it available asResult.