DX Dev Digest | OutSystems Tips & Trends | Phoenix DX

How to convert an Aggregate to a SQL element | OutSystems Dev

Written by Admin | Jun 22, 2026 11:38:55 AM


Convert an Aggregate to a SQL element

As your application grows, you might find the need to change how data is fetched in an existing Aggregate. If you require more advanced data fetching options, consider using a SQL element instead of an Aggregate. Converting an existing Aggregate to a SQL element allows you to continue evolving the SQL generated from the original Aggregate.

However, it's important to note that Aggregates offer several advantages:

  • Aggregates are optimised to fetch only the necessary rows and columns at runtime.
  • Maintaining an Aggregate requires less effort.

Therefore, it is recommended to start fetching data using an Aggregate and only switch to a SQL element when necessary.

How to convert an Aggregate to a SQL element

To convert an existing Aggregate to a SQL element, watch this tutorial from OutSystems Developer Kean Amper