Why should I use a Structure as Source of an Aggregate if it doesn’t have any data?

< Back to Blog

I have been working with OutSystems for over a year, but I have trained new developers in the last 10. I can assure you I have never worked with a software development tool as powerful and as easy to learn as Outsystems… but…

But sometimes things get confusing, and that is where things get interesting :)

I think I know very well OutSystems training materials, I use them almost every day, and some slides I even know them by heart.

A few weeks ago, one trainee came to me and asked, “Why should I use structures in an aggregate if they don’t have any data inside?”

My answer was something like: “Can you?”

But in reality, you can also mark a Structure as a Source:

However, if the structure (1) doesn’t have any data, and (2) the columns don’t even appear in the preview, the question is: Why?

  1. Because it isn’t a source like others.
  2. Because it has no data to show in aggregate.

Yet, it can store temporary data in those attributes left by the structure, extra attributes that can be used in the User Interface.

Structures are handled as Sources in an Aggregate because they are useful for the Aggregate to generate the SQL query. The SQL query result will include some extra null columns, like in the example below:




Using debug tools, you can see that at runtime, the aggregate now has 4 new “columns” containing default values.

Furthermore, those new fields can store data about particular rows in the list.

In the image above, you can see the usage of that boolean value to manipulate the color in an If widget. At this example, the two If widgets have the conditions: “EventTable.List.Current.CRUD.HasUpdated”, and, “EventTable.List.Current.CRUD.HasDeleted”, respectively.

To manipulate these values, you can use Check Boxes with the variable property set to "EventTable.List.Current.CRUD.HasUpdated” and “EventTable.List.Current.CRUD.HasDeleted”.

In the image below, you can see that if you select one Check Box, the value of that particular item on the list will change:

We must realize something… the items saved on that CRUD structure are just data saved on the widget list and are not persisted in the database. If you want to save or use that data in the future, you need to save it somewhere and remember that you don’t have an entity in the database for that. As soon as you refresh the screen, you will lose all that information.

Remember, learning OutSystems can be very rewarding. But it helps if you fall in love with the platform! The second you and OutSystems meet each other very intimately, you will understand its behavior.

Say hello to the future!

Turn Up Academy

Apply to our Turn Up Boot Camp


Latest Articles

Mastering Email Integration with OutSystems: A Step-by-Step Guide

Mastering Email Integration with OutSystems

In OutSystems Reactive Web Applications, we can configure the Service Center and implement logic in the Service Studio to send emails to our peers or contacts. Follow this step-by-step guide to learn how to!

How to use WebAssembly inside OutSystems - Part 2

How to use WebAssembly inside OutSystems - Part 2

WebAssembly (WASM) is a new technology that is getting a lot of attention. We continue the use of Go compiled to WASM to show how we can use WASM inside OutSystems.

How to use WebAssembly inside OutSystems - Part 1

How to use WebAssembly inside OutSystems - Part 1

WebAssembly (WASM) is a new technology that's getting a lot of attention. On the browser, Javascript was the only programming language supported until the WASM Standard came out. OutSystems is designed to be a high performance platform, so we'll show you how to use WASM within OutSystems to take advantage of the extra performance points that WASM provides.