Record Editor

Record is the type system introduced by the Ballerina language to hold data by a user. You can use records when you want to define data schemas. Once the records are created, you can easily manipulate data inside a program.

Ballerina is a multi-paradigm language. You can define records in an imperative manner with Ballerina. On top of that, the Ballerina VS Code plugin comes with record editing capabilities, which will help you to edit records graphically.

In the record editor, you have the ability to create a record from scratch or create a record by importing a JSON.

Create records from scratch

Follow the steps below to create records from scratch.

  1. Open a Ballerina package in VS Code.

  2. Navigate to the record editor and select Create New.

  3. Double-click the default record name to change it.

  4. Click the plus button at the end of the field to add new fields to the record.

    Info: Use the Expressions tab in the record editor to create nested records by selecting the particular record expression.

  5. Select the semicolon(;) of a field and select the default value expression to add default values.

  6. Use the isClosed option to switch between the open and closed records.

  7. Once the record field configuration is done, click Save.