How do I use variables?

An important part of building bezls is the ability to create variables which allow you to store and format data in a wide variety of different ways. Variables can be used in markup and in functions. This article will show you the basics!

We will start with a blank custom builder screen. Right click on the Variables folder.

2019-10-02 15_48_01-Window

By default it will be called var0, you can right click on the variable to rename or edit the variable.

2019-10-02 15_49_03-Window

When you edit the variable it takes you to the edit screen. You define variables as JSON, by default it’s an empty string "" but you can create complex JSON objects {} or arrays as well [].

Clicking the verify button will verify that you have created a valid JSON object.

2019-10-02 15_50_46-Window

With that done, you can use the variable in your bezl. You can use variables in the Design section, in functions, or in building data subscriptions. Here I am using Angular syntax to bind that variable to a text box, and display the JSON content of the variable:

2019-10-02 15_53_13-Window

When I preview the bezl, changes made in the input box are automatically reflected in the display of the variable.

2019-10-02 15_53_53-Window