what is the difference between data action and aggregate, both are using for data fetching ,when we use aggregate & when we use data action .I just want to know the scenario where we can define this.
Hi Mohini,
You can use a Data Action whenever you need to have more complex SQL queries, or even fetch data from an external source, like a webservice or even a server action.
The behavior of a Data Action, when it comes to Fetch (at start or on demand) and the After Fetch event, is exactly the same as for an Aggregate.
You can find further information here:
https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Interfaces/Adding_Data_and_Logic/Data_Action
Hope this helps.
Best regards,
Paulo Moreira
Hi,
As you can read in this link "Data Actions run on the server. You can create Data Actions to fetch complex data from the database, which you are not able to achieve using a single server Aggregate, or to fetch data from an external system, for example through a consumed REST API. Data Actions run simultaneously with the client and server Aggregates to fetch data after each Screen loads."
I hope this helps!
Hi @Mohini Rajput ,
The main difference between Data Action and Aggregate is - Data action is used when we need to fetch data from Server Action, Rest/Soap API and from SQL Query .
-Aggregates are used to fetch data from database entity .
And for more detail you can also read this discussion.
I hope it will clear your doubt .
Difference between Data action and Aggregate:
Data Action: Data action is used to fetch data from external sources, Server action, REST and SOAP API and SQL query.
Aggrgates:Aggregates are used to fetch data from database entity.
In above image, you can see that when you want to fetch data from database you will select fetch data from database option. And when you want to fetch complex data or data from external source, API you will select fetch data from other sources.