Expression
Collaborate with us
Edit this page on GitHub
The expression widget displays text or the result of an expression at runtime. It's similar to the print command in other programming languages. To use the expression widget:
-
In the widget toolbar, search for expression and drag the widget to a screen, block or placeholder. The expression editor opens.
-
Enter an expression in the expression editor and click Done.
You can use one of these examples as the expression:
"Hello, world!"
"1 + 2 = " + (1 + 2)
"The square root of 3 is " + Sqrt(3)
"Today is " + CurrDate() + "!"
ToUpper("this is text in uppercase")
-
Publish the app and open the screen.
Here is what you get if you use one of the examples in the previous step:
- Hello, world!
- 1 + 2 = 3
- The square root of 3 is 1.73205080756887729352744634151
- Today is 2020-10-08!!
- THIS IS TEXT IN UPPERCASE
We've been working on this article. Please let us know how useful this new version is by voting.
Properties
Name | Description | Mandatory | Default value | Observations |
---|---|---|---|---|
Name | Identifies an element in the scope where it's defined, like a screen, action, or module. | Yes | ||
Value | Combination of values, operands, operators and variables or the result of a function, computed at runtime. | Yes | ||
Example | Text displayed in the Preview and Design modes. | |||
Style Classes | Specifies one or more style classes to apply to the widget. Separate multiple values with spaces. | |||
Attributes | ||||
Property | Name of an attribute to add to the HTML translation for this element. | You can pick a property from the drop-down list or type a free text. The name of the property isn't validated by the platform. Duplicated properties aren't allowed. Spaces, " or ' are also not allowed. |
||
Value | Value of the attribute. | You can type the value directly or write expressions using the Expression Editor. If the Value is empty, the corresponding HTML tag is property="property". For example, the nowrap property doesn't require a value, therefore its value is nowrap="nowrap". |
Events
Name | Description | Mandatory | Observations |
---|---|---|---|
Event | JavaScript or custom event to handle. | ||
Handler | JavaScript event handler. |
Runtime properties
Name | Description | Read Only | Type | Observations |
---|---|---|---|---|
Id | Identifies the widget instance at runtime (HTML 'id' attribute). You can use it in JavaScript and Extended Properties. | Yes | Text |