Skip to content
  • There are no suggestions because the search field is empty.

Create Record step

The use and options of the Create Record step in Actions


After reading this article, you’ll know the following:

  • What the Create Record step is and its purpose

  • How to use this step in your application

What is the Create Record step?

Create record is a CRUD action step designed to add new records to a database. This step allows users to define and assign values to the properties of these records, using either static values or dynamic variables. By leveraging this functionality, users can efficiently manage and manipulate data within their applications.

betty-blocks.intercom-attachments-7.comio1082166878f57ab75517f12161896708fbAD_4nXdIQUdHZu9dAV9x4ttzID7ukOZZXwcMyjLDrZXTi7lgHum7EhEin9Q77GC7ySguD
 

In managing employee onboarding, when a new hire fills out their onboarding form with details like name, position, start date, and contact information, the Create Record step in Betty Blocks can automatically create a new record in the Employee model.

betty-blocks.intercom-attachments-7.comio10821668884145060e6a2b7e9e0019fa07AD_4nXfSQiwgCmXjlz9Nk7HNcfWGIIZvTiBkBkMN-WAKjjzUf8U-_MmwRvJgGT8VjpVW4
 

This ensures accurate recording and storage of new employee information, allowing HR to access details easily and initiate further onboarding tasks like provisioning equipment or scheduling orientation sessions.

Options

Model: Select the model where the new record will be created.

betty-blocks.intercom-attachments-7.comio10821668975df207cf2009426c3624a0b7AD_4nXctdJTRnI801J2SkDVWOHX6zej8At9ExLUU1Ri7vLM08PCVVFum5eIbd1nKlszwr
 

Value mapping feature enables you to map new values to the properties of the selected record. These values can be either static, where you manually input the values, or dynamic, where you use variables. The new values provided will overwrite the existing values in the record.

betty-blocks.intercom-attachments-7.comio10821669141a21f6135ed9225109aeae72AD_4nXcfUnfs5xrGpRRhQigilgP55vPJ2dufZ8x6LmrPHpYAOFYIc1KgXEwT-cGWfIFjR
 

As: Define the variable name for the new record. This variable can be reused in subsequent steps within the same action.

betty-blocks.intercom-attachments-7.comio108216692065d1192ec3e59a51380ce9a8AD_4nXeu_FCgatTseIVxjltfFOnjYmeolh545y6P9LT9Xu1Wovj8B0UJLO8KjvWmhETlS
 

Variables: In this separate tab, you can add more variables to the step, which can be used for dynamic value mapping. This is particularly useful when the values that need to be assigned depend on other variables or calculations within your application.

betty-blocks.intercom-attachments-7.comio1082166932c84b2720bf05104426437766AD_4nXfnG9XLzHvnDgNXqCgPIeDUMUfxK8WiZtNdAG05njcBHyhLEhZrhmP2st2uw0FJh
 

Use case - Create Form component

One of the easiest and most intuitive ways to use the Create Record step in Betty Blocks is through the Create Form component in Pages. Applying this component, users can quickly set up a form that captures and stores data in a specified model with minimal configuration.

betty-blocks.intercom-attachments-7.comio1082166948eaf7436241ae1a70eb7878b4AD_4nXdkAtihoAGNg-5MtZxqmIh6CsHzvelDK7RX2IbQPcyyrdRlARz6B60PG7Iqes7bR
 

To get started, simply drop the Create Form component onto the Pages canvas. You will then be prompted to configure the form:

  1. Select model: Choose the model where you want the data to be stored. For instance, if you are managing employee onboarding, you would select the "Employee" model.

  2. Select properties: Specify the properties you want to include in the form. These could be fields like Name, Email, Start date, Active, etc.

downloads.intercomcdn.comio10821640305cdae88b4b6e8964186e26deGIF1
 

Create form not only generates the form fields but also automatically creates a new action with pre-configured values and the Create Record step.

After setting up the Create Form, navigate to the form's options and locate the action attached to it. Use the pencil icon to edit this action.

betty-blocks.intercom-attachments-7.comio1082166964d884a5b0d14210f3ff283229AD_4nXcHFLFaMF4tj9ToLf_SG1UJvlWOBUjXbE-KtpB2VYOXpCKpGQIZOvt0ksjrkqOvD
 

You'll notice that:

  • Start step, which passes the variables from the form to the "Create Record" step, is already set up.

  • The fields in the Create Record options are pre-filled with the form's values.

  • In the Finish step, there’s the result value picked up from the Create Record step

downloads.intercomcdn.comio1082165389a618fb31cb86f16a1f93fc3cGIF2
 

Use case - Condition flow result

Another use case for the Create Record step is within a flow that includes a Condition step. For instance, in managing email configurations, you can use the Condition step to check if an email configuration record exists in the database.

If it exists, drop the Update Records step to the True flow to update the existing record with new values, which you fill in yourself in the Value mapping section (e.g., Port, Username, Password, Hostname). If it doesn't exist (Else flow), the Create Record step creates a new email configuration record. This ensures that email configurations are either updated or newly created as needed.

betty-blocks.intercom-attachments-7.comio108216697456019f8861e3c55aed8dcf95AD_4nXf6gnnaJEC6pq890N0oUlQqufgC6hiFGT72P-jt1ADXKdZye2084pNnlz2bVHRfq
 

In most cases, the Create Record step is implemented via the Create Form component on the front end, allowing users to fill out forms and have their data saved automatically. However, this step can also be used within other action flows, offering flexibility to manage data efficiently in various scenarios.