Empty table records fed by sql


Whenever I refresh one page that has a table record fed by SQL I'd like to have an empty table. 

maybe I will create a local variable named as IsFirst (boolean data type and initially set as true) and in the preparation I use the if conditional. If the IsFirst is true then it will not show any records in the table records. Otherwise it will. The problem is how to show an empty table records fed by sql.


I have no clue what you are asking us (I think it's a matter of translations I suppose)

What is the issue exactly?

The sql code generates always a result, it delivers thousands of  records (or a few results after using the search box). When we access the page for the first time or whenever we refresh the page,  I want to have an empty table records. 

Hi Jorge,

First of all, can you explain a bit more why do you want such a UI? It seems strange, to say the least...

That being said, in an Aggregate, you can add a filter that is basically "IsFirst = False", for SQL add a WHERE clause with "@IsFirst = 0" or something, where IsFirst is your boolean variable... that way the result set will be empty, as no record will satisfy the clause until you set IsFirst to False.


What you want to achieve is that whenever you enter or refresh a list screen you want a clean screen, without data in the Table Record. And when you use the filter, then you populate the TR with data, right? 

If this is the case, you should create a local List variable with the same type (Objects) as the Query Output. This List Variable will be the source of the Table record on the screen. 

In the preparation, you will only have to do a list clear "ListClear (System)" for the Local Variable (without executing the query). On the other hand, you will have a screen action, linked to the Filters. Everytime you use the filter, the screen action will run. Inside the screen action you need to execute the query and point the local variable to that results.

Is this what you are looking for?

(Avoif If's in the preparation before queries execution to avoid ViewState problems (Outsystems Performance best practices))


Could you satisfy my curiosity and explain why do you want the list to be empty every time you enter the page?

Is to avoid an excessive number of records?

If it os so, a better approach would be to use pagination, as you will retrieve, effectively, only the records to fill the number of lines defined in the screen list/table records.

If, for some reason, you can't get to put pagination to work, or don't want to use pagination, another approach would be to define that the query only return results if there are a minimum number of characters in the search string. You can get the len of the search string and pass to the sql through input parameter and add a condition in the where clause like this:

@length > 3


(other filters here)

This way, you will have results only if the search string reachs 3 characters (or any number you want).

If the reason is different, could you explain what's the reason to this requirement?


Eduardo Jauch