Ask AI
Skip to main content

Update an ext. database

Function: Update an external database

This action allows you to modify existing records within an external database that is connected to your application. You can specify which table to update, define filters to target specific records, and provide the new data to be applied.

Input,

  • Database connection: The connection details for the external database you wish to update.
  • Table: The name of the specific table within the database where you want to update records.
  • Data format: The structure or schema that describes the data in the chosen table. This helps the platform understand the fields you are working with.
  • Filters: (Optional) A set of conditions to identify which records in the table should be updated. You can add multiple filters, each consisting of:
    • Attribute: The specific field in your data format to check.
    • Operator: How the attribute should be compared (e.g., "Equal", "Greater than", "Contains").
    • Value: The value to compare against the attribute.
  • Data: The new information you want to apply to the selected records. This should be provided as a structured set of key-value pairs, where keys match the attributes in your data format.

Output,

No direct output is returned by this action. Its primary effect is the modification of data in the external database.

Execution Flow,

Real-Life Examples,

Here are some practical ways you can use the "Update an external database" action:

Example 1: Update a customer's email address

Imagine a customer updates their email address through a form in your application. You need to reflect this change in your external customer database.

  • Inputs:
    • Database connection: My CRM Database
    • Table: Customers
    • Data format: Customer Profile (with fields like CustomerID, Email, Name)
    • Filters:
      • Attribute: CustomerID
      • Operator: Equal
      • Value: 12345 (the ID of the customer who updated their email)
    • Data:
      \{
      "Email": "[email protected]"
      \}
  • Result: The customer record with CustomerID 12345 in the Customers table of My CRM Database will have its Email field updated to [email protected].

Example 2: Mark all pending orders as 'processing' for a specific product

Suppose a new batch of a popular product has arrived, and you want to update all customer orders for that product from "Pending" to "Processing".

  • Inputs:
    • Database connection: My E-commerce Database
    • Table: Orders
    • Data format: Order Details (with fields like OrderID, ProductID, Status)
    • Filters:
      • Filter 1:
        • Attribute: ProductID
        • Operator: Equal
        • Value: PROD-XYZ
      • Filter 2:
        • Attribute: Status
        • Operator: Equal
        • Value: Pending
    • Data:
      \{
      "Status": "Processing"
      \}
  • Result: All records in the Orders table where ProductID is PROD-XYZ AND Status is Pending will have their Status field updated to Processing.

Example 3: Correct a typo in a product description

You discover a common typo in the description of a product across multiple entries in your product catalog.

  • Inputs:
    • Database connection: Product Catalog DB
    • Table: Products
    • Data format: Product Information (with fields like ProductName, Description)
    • Filters:
      • Attribute: Description
      • Operator: Contains
      • Value: incorrectly spelled word
    • Data:
      \{
      "Description": "corrected spelling of the word"
      \}
  • Result: Any product record in the Products table whose Description field contains "incorrectly spelled word" will have that specific part of its Description updated to "corrected spelling of the word". (Note: For complex text replacements, you might need to combine this with other actions or ensure your database supports partial updates based on Contains for text fields).