Update an ext. database
Function: Update an external database
This function allows you to modify existing records in an external database connected to your platform. You can specify which records to update using filters and then provide the new data to be applied to those records.
Input
- Database connection: The connection details for the external database you want to interact with. This tells the platform where to find your database.
- Table: The name of the specific table within your chosen database where you want to update records.
- Data format: Defines the structure of the records you are updating. This ensures that the data you provide matches the columns in your database table.
- Filters: A set of conditions that determine which specific records in the table will be updated. If no filters are provided, the action will attempt to update records based on matching keys within the provided data.
- Attribute: The specific field (column) in your data structure that you want to use for filtering.
- Operator: How the selected attribute should be compared to the value (e.g., "Equal to", "Greater than", "Contains").
- Value: The specific data point to compare against the attribute.
- Data: The new information you want to apply to the matching records. This should be provided as structured data (like a JSON object) where each key corresponds to a field in your data format and its value is the new data for that field.
Output
This function does not return any direct output. Upon successful execution, the specified records in your external database will be updated.
Execution Flow
Real-Life Examples
Here are some practical examples of how you can use the "Update an external database" function:
Example 1: Update a customer's email address
Imagine you have a customer management system, and a customer has requested to change their email address.
- Inputs:
- Database connection:
My CRM Database - Table:
Customers - Data format:
Customer Profile(with fields likeCustomerID,FirstName,LastName,Email) - Filters:
- Attribute:
CustomerID - Operator:
Equal - Value:
12345
- Attribute:
- Data:
\{
"Email": "new.email@example.com"
\}
- Database connection:
- Result: The customer record with
CustomerID12345in theCustomerstable will have itsEmailfield updated tonew.email@example.com.
Example 2: Change the status of multiple pending orders to "Processing"
You want to automate the process of moving orders from a "Pending" state to "Processing" after a certain check.
- Inputs:
- Database connection:
E-commerce Orders DB - Table:
Orders - Data format:
Order Details(with fields likeOrderID,CustomerID,OrderStatus,OrderDate) - Filters:
- Attribute:
OrderStatus - Operator:
Equal - Value:
Pending
- Attribute:
- Data:
\{
"OrderStatus": "Processing"
\}
- Database connection:
- Result: All records in the
Orderstable where theOrderStatusisPendingwill have theirOrderStatusupdated toProcessing.
Example 3: Adjust the price of specific products in a category
You need to apply a price correction to all "Smartwatch" products within the "Electronics" category.
- Inputs:
- Database connection:
Product Catalog DB - Table:
Products - Data format:
Product Information(with fields likeProductID,ProductName,Category,Price) - Filters:
- Filter 1:
- Attribute:
Category - Operator:
Equal - Value:
Electronics
- Attribute:
- Filter 2:
- Attribute:
ProductName - Operator:
Contains - Value:
Smartwatch
- Attribute:
- Filter 1:
- Data:
\{
"Price": 299.99
\}
- Database connection:
- Result: All product records in the
Productstable that belong to theElectronicscategory AND haveSmartwatchin theirProductNamewill have theirPriceupdated to299.99.