Create data
Function: Create data
This action allows you to create a new record in your application's built-in database. You can define the structure of this record using a "Data-format" and then provide the actual values for its fields. This is useful for storing new information, like a new customer, a product, or an order.
Input
- Name (STRING, Required, Default: 'New data'): The name you want to give to this new data record. This helps you identify it later.
- Data-format (DATA_FORMAT, Required): The blueprint or structure that defines what kind of data you are creating. For example, if you're creating a "Customer" record, you would select your "Customer" Data-format here.
- Body (OBJECT, Required): This is where you provide all the specific details (fields and their values) for your new data record. The fields you can enter here will be based on the "Data-format" you selected. For instance, if your "Customer" Data-format has fields like "First Name", "Last Name", and "Email", you would fill in those values here.
Output
- Data id (STRING, Default: CREATED_DATA_ID): The name of a variable where the unique identifier (ID) of the newly created data record will be stored. You can then use this ID in other actions, for example, to update or retrieve this specific record later.
Execution Flow
Real-Life Examples
-
Creating a New Customer Record Imagine you have a form on your website where new users can sign up. After they submit the form, you want to store their information in your database.
- Inputs:
- Name:
John Doe
- Data-format:
Customer
(assuming you have a Data-format named "Customer" with fields likefirstName
,lastName
,email
,phone
) - Body:
\{
"firstName": "John",
"lastName": "Doe",
"email": "[email protected]",
"phone": "123-456-7890"
\} - Data id:
NewCustomerID
- Name:
- Result: A new customer record named "John Doe" is created in your database under the "Customer" Data-format. The unique ID for this new customer (e.g.,
cust_12345
) is stored in a variable calledNewCustomerID
, which you can then use to send a welcome email or link other data.
- Inputs:
-
Adding a New Product to Inventory You're managing an e-commerce store and want to add a new product to your inventory.
- Inputs:
- Name:
Wireless Headphones Pro
- Data-format:
Product
(assuming a "Product" Data-format with fields likeproductName
,description
,price
,stockQuantity
) - Body:
\{
"productName": "Wireless Headphones Pro",
"description": "Premium noise-cancelling headphones with long battery life.",
"price": 199.99,
"stockQuantity": 150
\} - Data id:
NewProductID
- Name:
- Result: A new product record for "Wireless Headphones Pro" is added to your inventory. Its unique ID is saved in the
NewProductID
variable, allowing you to reference this product in order management or display it on your product pages.
- Inputs:
-
Recording a Support Ticket When a user submits a support request through your application, you want to create a new ticket in your helpdesk system.
- Inputs:
- Name:
User Login Issue
- Data-format:
SupportTicket
(assuming a "SupportTicket" Data-format with fields likesubject
,description
,reporterEmail
,status
) - Body:
\{
"subject": "Cannot log in to account",
"description": "I am unable to log in. My password reset link is not working.",
"reporterEmail": "[email protected]",
"status": "Open"
\} - Data id:
TicketID
- Name:
- Result: A new support ticket is created with the details provided. The unique ID of this ticket is stored in the
TicketID
variable, which can then be used to assign the ticket to an agent or send an automated confirmation email to the user.
- Inputs: