Skip to main content

 

 

 

 

Template:OutSystems/Documentation_KB/Breadcrumb_New_Layout

 

 

Template:OutSystems/OSLanguageSwitcher

 

 

 

OutSystems

Expression

Template:OutSystems/Documentation_KB/ContentCollaboration
  • Edit
    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:

    1. In the widget toolbar, search for expression and drag the widget to a screen, block or placeholder. The expression editor opens.

      Expression widget

    2. Enter an expression in the expression editor and click Done.

      An expression in the expression editor

      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")
    3. 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
    • Was this article helpful?