User Initials
We’ve been working on this article. Please let us know how useful this new version is by voting.
You can use the User Initials UI Pattern to display a user’s initials or their image in a circular badge.
How to use the User Initials UI Pattern
The User Initials 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 initials of the registered users on your platform.
-
In Service Studio, in the Toolbox, search for
User Initials
.The User Initials widget is displayed.
-
From the Toolbox, drag the User Initials widget into the Main Content area of your application's screen.
-
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.
-
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 the users on your platform.
-
To reopen your screen, select the Interface tab, and double-click on your screen.
-
Select the User Initials widget, and on the Properties tab, from the Name drop-down, select Expression Editor.
-
In the Expression Editor, enter the following expression and click Done.
GetUsers.List.Current.User.Name
Note: You can also add the expression by navigating through the Expression Editor's Scope tree and double-clicking on the Name output parameter.
The Name property is now set to display the Name property of the Aggregate you added to the Preparation action, which gets the names of the registered users on your platform and displays them in the badge.
-
On the Properties tab, you can also customize the badge's look and feel by setting any of the optional properties, for example, the color, shape, and size. The following example displays a blue, medium-sized, circle badge.
After following these steps and publishing the module, you can test the pattern in your app.
Properties
Property | Description |
---|---|
Name (Text): Optional | The initials that appear inside the badge. Set this to a Data source that contains the value that the badge will display. Common use cases include displaying a value contained in a Variable or the result of an Aggregate (for instance, querying a 'Messages' table for the current user to return the count of new messages). Examples
|
Color (Color Identifier): Optional | Set the badge color. Red, orange, yellow, lime, green, blue, violet, and pink are just some of predefined colors available for the badge. Examples
|
Shape (Shape Identifier): Optional | Set the badge shape. Rounded, soft rounded, and sharp are the predefined shapes available for the badge. Examples
|
Size (Size Identifier): Optional | Set the badge size. Small and medium are the predefined sizes available for the badge. Examples
|
IsLight (Boolean): Optional | Specify the badge's background color. Examples
|
ExtendedClass (Text): Optional | Add custom style classes to the User Initials UI Pattern. You define your custom style classes in your application using CSS. Examples
|