Update a data record
Function: Update a data record
This action allows you to modify an existing data record within your application's built-in database. It's used when you need to change information that is already stored, such as updating a customer's details, changing a product's price, or modifying the status of a task. This action is specifically for existing records; to add new records, you would use a "Create data record" action.
Input,
- Data (Required, Type: DATA) This is the specific data record you wish to update. You will provide the existing record, including the updated values for any fields you want to change. For example, if you're updating a customer's email, you would provide the customer record with the new email address.
- Async (Optional, Type: BOOLEAN, Default:
False) This setting determines whether the update should happen immediately or in the background.False(default): The platform will process the update and wait for it to complete before moving on to the next step in your application's logic. This is suitable when you need immediate confirmation that the data has been changed.True: The update process will start, but your application will immediately proceed to the next step without waiting for the update to finish. This is useful for long-running updates or when immediate feedback isn't critical, allowing your application to remain responsive.
Output,
This function does not produce a direct output value. Its primary purpose is to perform an action (updating data). If the update encounters any issues, it will report errors within the application's execution log.
Execution Flow,
Real-Life Examples,
Example 1: Updating a Customer's Email Address
Imagine a customer calls to update their contact information.
- Inputs:
Data: A specific "Customer" record where theEmailfield has been changed from "[email protected]" to "[email protected]".Async:False
- Result: The customer's email address in your database is immediately updated to "[email protected]", and your application can confirm the change.
Example 2: Changing the Status of a Project Task
When a team member completes a task in your project management application.
- Inputs:
Data: A "Project Task" record with itsStatusfield updated from "In Progress" to "Completed".Async:False
- Result: The project task's status is instantly marked as "Completed" in your project management application, reflecting the change for all users.
Example 3: Bulk Price Adjustment for Products (Background Process)
Your e-commerce store is running a promotion, and you need to reduce the price of many products by a small percentage.
- Inputs:
Data: A "Product" record where thePricefield is updated from "$100" to "$95". (This action would typically be part of a larger process that iterates through multiple products, updating each one).Async:True
- Result: The price adjustment for the product (and potentially many others if part of a larger process) is initiated in the background. Your application can immediately proceed to other tasks, such as generating a confirmation report, without waiting for all price updates to finalize.