Update a data record
Function: Update a data record
Description,
This function allows you to modify an existing data record within your application's built-in database. It's designed to update records that have already been created, for instance, by using an "Update object" action. If you need to add entirely new data, you should use the "Create data record" function instead.
Input,
- Data: This is the specific data record (or object) you want to change. You must provide the complete record, including the updated information.
- Async: This setting determines whether the update happens immediately or in the background.
- Type: True/False
- Default Value: False (meaning the update happens immediately)
Output,
This function updates the specified data record in your application's database. There is no direct output value returned to be used in subsequent steps, but the record in the database will reflect your changes.
Execution Flow,
Real-Life Examples,
Here are a few ways you might use the "Update a data record" function in your application:
Example 1: Correcting a Customer's Email Address
Imagine you have a list of customers, and one customer informs you that their email address is incorrect.
- Inputs:
- Data: A specific customer record where the
Emailfield has been changed from "old.email@example.com" to "new.email@example.com". - Async: False
- Data: A specific customer record where the
- Result: The customer's record in your database is immediately updated with the new email address.
Example 2: Updating Product Stock After a Sale
After a customer purchases an item from your online store, you need to reduce the available stock for that product.
- Inputs:
- Data: A product record where the
Stock Quantityfield has been reduced (e.g., from 100 to 99). - Async: False
- Data: A product record where the
- Result: The product's stock level in your database is instantly updated, reflecting the sale.
Example 3: Batch Updating User Preferences in the Background
A user changes several settings in their profile, such as notification preferences and theme choices. These updates don't need to happen instantly and can be processed without making the user wait.
- Inputs:
- Data: A user preferences record containing all the new settings (e.g.,
Receive Notificationschanged to True,Themechanged to "Dark"). - Async: True
- Data: A user preferences record containing all the new settings (e.g.,
- Result: The user's preferences are sent for an update in the background, allowing the user to continue interacting with the application without delay while the database is updated.