Try this method,
Start by creating a new app.

Add a Screen to your app. Go to Interface > UI Flows, right-click MainFlow and select Add Screen. In the New Screen window select Empty, enter Home as the Screen name, then click CREATE SCREEN. Service Studio adds an empty Screen to your app.

Add data sources to your app by referencing some Entities in the Manage Dependencies window (Ctrl+Q). This example app references OutSystems sample data. Once you reference Entities, they’re available in Service Studio under Data > Entities > Database.
Publish the app by clicking the 1-Click Publish button. This step is optional, but it lets the app show the data preview later.

It’s time to load some data to the Screen. Go to Interface > UI Flows > Main Flow, and then right-click your Home Screen. Select Fetch Data from Database. A new Aggregate edit screen opens, and there’s a notice that you need some data.
With the Aggregate still open, navigate to Data > Entities > Database > OutSystemsSampleDataDB. Drag the Sample_Employee Entity to the Aggregate window. If you’re using your data instead of OutSystems sample data, then drag some other Entity. Service Studio shows the data preview in columns and uses the Entity name to name the Aggregate.
Go back to Interface > UI Flows > Main Flow > Home and notice the GetEmployees Aggregate in the Screen. Expand the Aggregate to see the Entities, and then expand the Entities to list the Attributes. There’s also a warning that you’re not using the data anywhere.

Show data in a widget

Once you fetch data from the database, use one of many OutSystems widgets to show the data to the users. Continuing from the previous section, in this example you create a list with the employee last names.

Open your Home Screen for editing. To do that, double-click Home in Interface > UI Flows > Main Flow.

In the search bar, search for the List widget and drag the widget to the Screen. Service Studio now shows an empty List widget.
Click the List widget to select it, and go to the properties. In the Source field select GetEmployees.List. With this you’re telling the app which data source to use with this widget.
With your List widget connected to a data source, add some Attributes to show data in the List. Expand the Entity to see the Attributes, under Interface > UI Flows > Main Flow > Home > GetEmployees > Sample_Employee. Drag an Attribute, for example, LastName to the List widget. This tells the widget to list all last names that are in the database.

Leave a Reply

Your email address will not be published.