Create an object
Function: Create an object
This action allows you to build a new collection of information, often called an "object," directly within your application's memory. You define what pieces of information (fields) and their corresponding values this new object should contain. Once created, this object can be used immediately in subsequent steps of your logic, such as displaying it, saving it to a database, or using its values for calculations.
Input
- Object: This is where you define the structure and content of your new object. You'll specify all the individual fields (like "Name," "Email," "Price") and their initial values (e.g., "John Doe," "[email protected]," "99.99") that this object should hold. This input is required.
Output
- Object variable name: This is the name you give to the variable that will store your newly created object. You can then refer to this name in later steps to access the object and its data. If you don't provide a name, it will automatically be named
NEW_OBJECT.
Execution Flow
Real-Life Examples
Example 1: Creating a New Customer Record for Onboarding
- Scenario: You're building an onboarding flow for new customers. After collecting basic information, you want to create a temporary customer object to process before saving it to your database.
- Inputs:
- Object:
\{
"FirstName": "Alice",
"LastName": "Smith",
"Email": "[email protected]",
"Status": "Pending Activation"
\} - Object variable name:
NewCustomerData
- Object:
- Result: A new object named
NewCustomerDatais created in your application's memory, containing Alice Smith's details. You can now useNewCustomerDatain subsequent actions, like sending a welcome email or displaying a summary.
Example 2: Defining a Product Configuration for an Order
- Scenario: A user is customizing a product (e.g., a laptop). You need to capture their selections as a single object before adding it to their shopping cart.
- Inputs:
- Object:
\{
"ProductName": "Laptop Pro",
"Processor": "Intel i7",
"RAM": "16GB",
"Storage": "512GB SSD",
"Color": "Space Gray",
"Price": 1499.99
\} - Object variable name:
ConfiguredLaptop
- Object:
- Result: An object named
ConfiguredLaptopis created, holding all the chosen specifications for the laptop. This object can then be passed to an "Add to Cart" action.
Example 3: Storing a Calculation Result with Metadata
- Scenario: You've performed a complex calculation (e.g., total order value including tax and shipping) and want to store the final result along with some explanatory notes.
- Inputs:
- Object:
\{
"TotalAmount": 250.75,
"Currency": "USD",
"TaxRateApplied": 0.08,
"ShippingCost": 15.00,
"CalculationDate": "2023-10-27"
\} - Object variable name: (Left blank, using default)
- Object:
- Result: An object named
NEW_OBJECT(the default name) is created, containing the total amount and other relevant details of the calculation. This object can then be displayed to the user or logged for auditing.