
I am very new to Sharepoint flows and trying to learn and implement functionality I use in other apps.
It does not appear that aggregate functions are available in flow right now so I wondered if it is possible to group and filter from a Sharepoint list?
For example if I have a list of cities:
Paris
London
Miami
London
Paris
Chicago
New York
Paris
Paris
Chicago
Paris
Chicago
Birmingham
Chicago
Manchester
Chicago
I would want to group by city and count the number in
each group. If it were 5 or more in any grouping I would need to
update each of those records Y/N field as Y.
In this case there would be a grouping on 'Paris' as having 5 or more entries and also Chicago.
I am thinking though this may be easier to do in SQL Server using
stored procedures.
Any help greatly appreciated.
Hi @sienna28
If you can access your data through SQL Server, my preferred choice would be to use SQL Server. Like you say, you can build a stored procedure, but you could also create a view. With a view, you could quite easily view your results from PowerApps.
With Flow, I suspect you could accomplish this though a combination of looping through your input data, using variables to store a count for each city, conditions to check for a count of greater than 5 for any given city, and an array to store the results.
Although the article beneath doesn't carry out exactly what you want, I think it gives a gist of how you could carry this task.
https://flow.microsoft.com/en-us/blog/calculate-running-totals-and-tracking-maximum-values-in-flow/