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:
SELECT TOP (32) NULL o0, NULL o1, NULL o2, NULL o3, [ENEVENT].[ID] o4, [ENEVENT].[NAME] o5, [ENEVENT].[LOCAL] o6, [ENEVENT].[DATE] o7, [ENEVENT].[EVENTTYPE] o8, [ENEVENTTYPE].[ID] o9, [ENEVENTTYPE].[DESCRIPTION] o10
FROM ([OUTSYSTEMS].DBO.[OSUSR_BHT_EVENT] [ENEVENT]
Left JOIN [OUTSYSTEMS].DBO.[OSUSR_BHT_EVENTTYPE] [ENEVENTTYPE] ON ([ENEVENT].[EVENTTYPE] = [ENEVENTTYPE].[ID]))