Update a data-body
Function: Update a data-body
This function allows you to modify the internal details (the "body") of an existing piece of data within your application's current process. It's important to note that this action only updates the data temporarily in memory during the current workflow. It does not save these changes to your database. If you need to permanently store changes, you would typically follow this action with a "Save Data" or "Update Data" action.
Input,
- Existing data: The specific piece of data you want to modify. You'll select this from the data available in your current workflow. This input is required.
- Body: This is where you define the new information or changes you want to apply to your "Existing data". You can specify individual fields and their updated values, or you can select an entire "object" that contains the new structure you wish to apply. This input is required.
Output,
This function does not produce a new output variable. Instead, it directly modifies the "Existing data" you provided as an input within the current workflow. The updated data will then be available for subsequent actions in your process.
Execution Flow,
Real-Life Examples,
Here are a few examples of how you might use the "Update a data-body" function:
Example 1: Temporarily Adjusting a Product's Price for a Calculation
- Scenario: You're building a workflow to calculate a special discount, and you need to temporarily reduce a product's price before applying the discount, without changing the actual database price yet.
- Inputs:
- Existing data: Select a "Product" item from your current workflow (e.g.,
Current Product). - Body:
\{
"price": 85.00
\}
- Existing data: Select a "Product" item from your current workflow (e.g.,
- Result: The
Current Productitem in your workflow now has itspriceset to85.00. This change is only for the current calculation and is not saved to the database.
Example 2: Preparing User Profile Data Before Displaying a Form
- Scenario: A user is about to edit their profile. You want to pre-fill a form with their current details but also add a temporary "status" field that isn't part of their permanent profile, just for the form's logic.
- Inputs:
- Existing data: Select the "User Profile" object retrieved earlier in the workflow (e.g.,
LoggedInUser). - Body:
\{
"email": "[email protected]",
"phone": "555-123-4567",
"form_status": "editing"
\}
- Existing data: Select the "User Profile" object retrieved earlier in the workflow (e.g.,
- Result: The
LoggedInUserobject now includes the updatedemailandphonevalues, and a newform_statusfield set to "editing". This modified object can then be used to populate the user's profile editing form.
Example 3: Modifying a Configuration Object for a Specific Report
- Scenario: You have a general report configuration object, but for a specific report run, you need to temporarily override a few settings like the
report_titleanddate_rangewithout affecting the default configuration. - Inputs:
- Existing data: Select the "Report Configuration" object (e.g.,
DefaultReportConfig). - Body:
\{
"report_title": "Quarterly Sales Summary - Q3 2023",
"date_range": "2023-07-01 to 2023-09-30",
"include_charts": true
\}
- Existing data: Select the "Report Configuration" object (e.g.,
- Result: The
DefaultReportConfigobject is updated with the specific title, date range, and chart inclusion setting for this particular report generation. The originalDefaultReportConfigin the database remains unchanged.