range-in-list
Web icon

Range in List

Stable version 1.0.0 (Compatible with OutSystems 11)
Uploaded
 on 05 November 2021
 by 
0.0
 (0 ratings)
range-in-list

Range in List

Documentation
1.0.0

Range in List

Installation and Usage Manual

Range in List is a component that allows you to filter a range of records from a list in OutSystems. It is useful for scenarios where you need to display a subset of records from a large list, such as pagination, charts, or reports.

Installation

To install Range in List, follow these steps:

  1. Download the Range in List component from the Forge: https://www.outsystems.com/forge/component-overview/11868/range-in-list
  2. Open Service Studio and click on Manage Dependencies.
  3. Select the RangeInList module and add it to your application.
  4. Publish your application.

Usage

To use Range in List, follow these steps:

  1. In Service Studio, open the screen or action where you want to filter a range of records from a list.
  2. Drag and drop the RangeInList action from the RangeInList module to your logic flow.
  3. Set the InputList parameter of the action to the list you want to filter.
  4. Set the StartIndex parameter of the action to the index of the first record you want to include in the range.
  5. Set the EndIndex parameter of the action to the index of the last record you want to include in the range.
  6. Use the OutputList parameter of the action as the source of your widget or logic that displays or uses the filtered records.

Example

Here is an example of how to use Range in List in a screen that displays a table with pagination.

  1. Create a screen called Customers with an input parameter called PageNumber.
  2. Create a local variable called CustomersList of type List(Customer) and assign it to a sample data source of customers.
  3. Create a local variable called PageSize of type Integer and assign it to 10.
  4. Create a local variable called TotalPages of type Integer and assign it to Ceil(Length(CustomersList) / PageSize).
  5. Create a local variable called FilteredList of type List(Customer) and leave it empty.
  6. Drag and drop the RangeInList action from the RangeInList module to your preparation logic.
  7. Set the InputList parameter of the action to CustomersList.
  8. Set the StartIndex parameter of the action to (PageNumber - 1) * PageSize + 1.
  9. Set the EndIndex parameter of the action to PageNumber * PageSize.
  10. Set the OutputList parameter of the action to FilteredList.
  11. Drag and drop a Table Records widget from the Toolbox to your screen.
  12. Set the Source Record List property of the widget to FilteredList.
  13. Add columns and expressions to display customer data as desired.
  14. Drag and drop a Pagination widget from RichWidgets under your table.
  15. Set the CurrentPage property of the widget to PageNumber.
  16. Set the MaxPages property of the widget to TotalPages.

This way, you can display 10 customers per page and navigate between pages using Range in List.

Test Page

If you want to test the Range in List component, you can access the following page:

https://ruihmendes.outsystemscloud.com/RangeTeste/

This page allows you to enter a list of numbers and filter a range of records from it. You can also change the page size and number to see how the pagination works.

Questions and Answers

In this section, you will find some common questions and answers about the Range in List component.

What is the purpose of the Range in List component?
The Range in List component allows you to filter a range of records from a list in OutSystems. It is useful for scenarios where you need to display a subset of records from a large list, such as pagination, charts, or reports.
How does the Range in List component work?
The Range in List component uses an action that takes an input list and two index parameters (start and end) and returns an output list with only the records between those indexes.
What are some use cases for the Range in List component?
The Range in List component is useful for scenarios where you need to display a subset of records from a large list, such as pagination, charts, or reports. For example, you can use it to display 10 customers per page from a list of 100 customers, or to display the top 5 products by sales from a list of 50 products.