Ask AI
Skip to main content

Update a data-body

Function: Update a data-body

This function allows you to modify the content (or "body") of a piece of data that you are currently working with in your application. It's important to note that this action only updates the data in memory within your current workflow. It does not automatically save these changes to your database. If you need to permanently save the updated data, you would typically follow this action with another action like "Update data" or "Save data" to commit the changes to your database.

Input

  • Existing data (DATA): This is the specific piece of data you want to modify. You'll select this from the data available in your current workflow or application scope. It's like picking a specific record or item you're already looking at.
  • Body (OBJECT): This is where you define the new information you want to put into your "Existing data." You can either type in the new fields and their values directly, or you can select an existing "object" (a collection of key-value pairs) from your workflow that contains the updates. This input is crucial as it tells the system what to change in your data.

Output

This function does not produce a new, separate output. Instead, it directly modifies the "Existing data" you provided as an input. The "Existing data" object will now contain the updated "Body" information, ready for further processing or saving.

Execution Flow

Real-Life Examples

Example 1: Updating a Customer's Phone Number

  • Scenario: A customer support agent needs to quickly update a customer's phone number during a call.
  • Inputs:
    • Existing data: Customer Record (e.g., a customer record retrieved from a "Get Customer" action)
    • Body:
      \{
      "phoneNumber": "555-123-4567"
      \}
  • Result: The Customer Record in the current workflow is updated to reflect the new phone number. This updated record can then be passed to an "Update Customer in Database" action to save the change permanently.

Example 2: Changing the Status of an Order

  • Scenario: An order processing workflow needs to mark an order as "Shipped" after a shipping label is generated.
  • Inputs:
    • Existing data: Order Details (e.g., an order object retrieved from a "Find Order" action)
    • Body:
      \{
      "status": "Shipped",
      "shippingDate": "2023-10-27"
      \}
  • Result: The Order Details object in the workflow now shows the status as "Shipped" and includes the shipping date. This updated order can then be used by subsequent actions, such as sending a shipping confirmation email.

Example 3: Modifying Product Inventory Details

  • Scenario: A product manager wants to adjust the available stock and reorder threshold for a specific product.
  • Inputs:
    • Existing data: Product Item (e.g., a product record obtained from a "Get Product by ID" action)
    • Body:
      \{
      "stockQuantity": 150,
      "reorderThreshold": 50
      \}
  • Result: The Product Item object in the current process is updated with the new stock quantity and reorder threshold. This modified product data can then be saved to the inventory system using a "Save Product" action.