Ask AI
Skip to main content

Create data

Function: Create data

This action allows you to create a new record and store it in your application's built-in database. You can define the type of data you want to create (its "data-format") and provide all the necessary information for the new record.

Input,

  • Name (Text, required, default: 'New data') Specify a unique name for the new data record you are creating. This helps you identify it later.
  • Data-format (Data Format, required) Choose the type of data you want to create. This defines the structure and available fields for your new record (e.g., "Product", "Customer", "Order").
  • Body (Object, required) Provide all the details and values for the fields of your new data record. The structure of this information must match the selected "Data-format". For example, if your "Data-format" is "Product", you might provide fields like "Product Name", "Price", and "Description".

Output,

  • Data id (Text, required, default: CREATED_DATA_ID) This is 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 to reference or modify the record.

Execution Flow,

Real-Life Examples,

Example 1: Creating a New Product

Imagine you're building an e-commerce application and want to add a new product to your inventory.

  • Inputs:
    • Name: "Wireless Headphones"
    • Data-format: "Product"
    • Body:
      \{
      "ProductName": "Wireless Headphones",
      "Price": 79.99,
      "Description": "High-quality wireless headphones with noise cancellation.",
      "InStock": true,
      "SKU": "WH-NC-001"
      \}
    • Data id: NEW_PRODUCT_ID
  • Result: A new product record named "Wireless Headphones" is created in your database under the "Product" data-format. Its unique ID is stored in the variable NEW_PRODUCT_ID, which you can then use to display the product on a page or link it to orders.

Example 2: Registering a New Customer

You have a customer registration form on your website, and after a user submits it, you want to create a new customer record.

  • Inputs:
    • Name: "Jane Doe"
    • Data-format: "Customer"
    • Body:
      \{
      "FirstName": "Jane",
      "LastName": "Doe",
      "Email": "[email protected]",
      "PhoneNumber": "555-123-4567",
      "RegistrationDate": "2023-10-26"
      \}
    • Data id: CUSTOMER_RECORD_ID
  • Result: A new customer record for "Jane Doe" is added to your database. The unique ID for this customer is saved in the CUSTOMER_RECORD_ID variable, allowing you to associate future actions (like placing an order) with this specific customer.

Example 3: Adding a New Task to a Project

In a project management application, when a project manager assigns a new task, you want to create a task record.

  • Inputs:
    • Name: "Develop User Login Feature"
    • Data-format: "Task"
    • Body:
      \{
      "TaskName": "Develop User Login Feature",
      "Description": "Implement secure user authentication and registration.",
      "AssignedTo": "John Smith",
      "DueDate": "2023-11-15",
      "Status": "To Do",
      "Priority": "High"
      \}
    • Data id: PROJECT_TASK_ID
  • Result: A new task record named "Develop User Login Feature" is created in your database under the "Task" data-format. The unique ID of this task is stored in the PROJECT_TASK_ID variable, which can be used to update its status or link it to a specific project.