I am currently working on a Power Automate flow that fetches transaction line data from Exact Online using the CDATA Cloud connector. The goal is to group the data based on GLAccountCode while retrieving the minimum (LeastFinancialYear) and maximum (HighestFinancialYear) financial years. Below is the SQL query being executed:
SELECT GLAccountCode, MIN(FinancialYear) AS LeastFinancialYear,
MAX(FinancialYear) AS HighestFinancialYear
FROM [ExactOnline1].[3243703].[TransactionLines]
GROUP BY GLAccountCode;
Since this query processes a large dataset, it takes a considerable amount of time to execute. However, Power Automate has a 2-minute timeout limitation for SQL queries, causing the flow to fail before retrieving the results.
I would appreciate any guidance on optimizing the query or any best practices to handle large dataset processing efficiently within Power Automate. Additionally, if there are alternative approaches—such as running the query in batches, using stored procedures, or leveraging data pre-aggregation techniques—please advise on how best to implement them.
Looking forward to your insights.