Ask AI
Skip to main content

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 like CustomerID, FirstName, LastName, Email)
    • Filters:
      • Attribute: CustomerID
      • Operator: Equal
      • Value: 12345
    • Data:
      \{
      "Email": "new.email@example.com"
      \}
  • Result: The customer record with CustomerID 12345 in the Customers table will have its Email field updated to new.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 like OrderID, CustomerID, OrderStatus, OrderDate)
    • Filters:
      • Attribute: OrderStatus
      • Operator: Equal
      • Value: Pending
    • Data:
      \{
      "OrderStatus": "Processing"
      \}
  • Result: All records in the Orders table where the OrderStatus is Pending will have their OrderStatus updated to Processing.

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 like ProductID, ProductName, Category, Price)
    • Filters:
      • Filter 1:
        • Attribute: Category
        • Operator: Equal
        • Value: Electronics
      • Filter 2:
        • Attribute: ProductName
        • Operator: Contains
        • Value: Smartwatch
    • Data:
      \{
      "Price": 299.99
      \}
  • Result: All product records in the Products table that belong to the Electronics category AND have Smartwatch in their ProductName will have their Price updated to 299.99.