Back to VS Code home
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.
Open a Ballerina package in VS Code.
Navigate to the record editor and select Create New.
Double-click the default record name to change it.
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.
Select the semicolon(;) of a field and select the default value expression to add default values.
Use the isClosed option to switch between the open and closed records.
Once the record field configuration is done, click Save.