Use one Aggregate and populate two tables with different filter result?

I need to populate two very similar tables in one screen , except with differential in one column of theirs.

Let say table A need to get all students, table B need to get all teachers. Both tables get result from the same entity.

I can create two aggregates in the preparation screen, with each call action filter based on different condition. so table A will filter just based on occupation = students, B on occupation=teachers.

However this would be equivalent to sending two Http requests just to call the same entity on the same screen.

Is there a way in Outsystems where I can just create an aggregate to get both teachers and students, and on the UI I can populate table A(student) and table B(teacher) by filtering conditionally?

Hi Tony,

If you're talking Web Applications, then two aggregates correspond to two database queries, not two HTTP requests, and they're likely the most efficient way.

You can always use the ListFilter built-in action on the Preparation, after your aggregate, to create two lists based on the differentiator you have. Your Table Records would then use these lists as their Source Record List.

If you're talking Mobile Apps, then you would need to do all this in the OnAfterFetch of your aggregate (or execute the entire thing - Aggregate plus ListFilter calls - on a Data Fetch)

Hope this helps