Skip to main content




Applies only to Traditional Web Apps
Service Studio version:


  • Edit
    Collaborate with us
    Edit this page on GitHub
  • We’ve been working on this article. Please let us know how useful this new version is by voting.

    You can use the Counter UI Pattern to display numerical information as a notification. For example, the Badge UI pattern is frequently used to notify users about the number of unread emails, unopened messages, or new tasks they may have.

    How to use the Counter UI Pattern

    The Counter UI Pattern usually displays dynamic information. In most cases, prior to using this pattern, you will need to retrieve or update the Data that contains the information you want to display onscreen. You do this by using an Action.

    The following example demonstrates how you can display the number of registered users on your platform.

    1. In Service Studio, in the Toolbox, search for Counter.

      The Counter widget is displayed.

      If the UI widget does not display, it may be because you used a ready-made app, which deletes unused widgets from the module. To make additional widgets available in your app:

      a. Go to Module > Manage dependencies.

      b. Search for and select the relevant Producer, for example OutSystemsUI. Ensure Show All is selected.

      c. On the Public elements for the selected Producer displayed on the right, ensure Show All is selected.

      d. Search for and select the element you want to add, and click Apply.

      e. In Service Studio, in the Toolbox, search for the widget again.

    2. From the Toolbox, drag the Counter widget into the Main Content area of your application's screen.

    3. From the Element tree, create a Preparation action by right-clicking on your screen, and from the drop-down, select Add Preparation.

      This Preparation action executes logic that fetches the data before the screen is displayed.

    4. Select the Data tab, and from the Entities tree, navigate to the User entity and drag it onto the Preparation action.

      This creates an aggregate that retrieves all of the users on your platform.

    5. To reopen your screen, select the Interface tab, and double-click on your screen.

    6. Within the Counter widget, right-click in the Text widget (containing the number 26), and select Convert to Expression.

    7. In the Expression Editor, enter the following expression and click Done.


      Note: You can also add the expression by navigating through the Expression Editor's Scope tree and double-clicking on the Count output parameter.

    You have now created an expression that displays the Count property of the Aggregate you added to the Preparation action, which gets the number of users on your platform and displays them in your Counter.

    1. From the Properties tab of each of the Counter's widgets, you can customize the Counter's display text and icon. For this example, the display text is changed to Registered Users.

    2. Additionally, on the Properties tab, you can customize the Counter's look and feel by setting any of the optional properties, for example, the height and orientation.

    After following these steps and publishing the module, you can test the pattern in your app.


    Property Description
    Orientation (Orientation Identifier): Optional Set the counter orientation. By default the counter is displayed horizontally.


    • Entities.Orientation.Horizontal - The counter displays horizontally
    • Entities.Orientation.Vertical - The counter displays vertically
    Height (Text): Optional Set the counter height. By default the counter height is 100 (pixel units).
    ExtendedClass (Text): Optional Adds custom style classes to the Pattern. You define your custom style classes in your application using CSS.


    • Blank - No custom styles are added (default value).
    • "myclass" - Adds the myclass style to the UI styles being applied.
    • "myclass1 myclass2" - Adds the myclass1 and myclass2 styles to the UI styles being applied.
    You can also use the classes available on the OutSystems UI. For more information, see the OutSystems UI Live Style Guide.
    • Was this article helpful?