Power Automate

Building a Fantasy Premier League Leaderboard with Power Automate

How I built a four-gameweek FPL competition with Power Automate, SharePoint and Teams, including scoring ties, postponed fixtures and safe retries.

A season-long Fantasy Premier League table answers who’s ahead overall. I wanted our mini-league to have another question to argue about: who had the best last four gameweeks? That gave me a shorter competition to score and a reason to bring the results into the Teams chat where people could actually see them.

I built a scheduled Power Automate flow that reads results from the FPL website, saves each four-gameweek window in SharePoint, and posts standings as an Adaptive Card in Teams. The code, import package and a fictional dataset are available in the repository. FPL Window Leaderboard source

Score each window from cumulative points

I use the difference between two values FPL already provides. For Gameweeks 5–8, I subtract a manager’s cumulative total at the end of Gameweek 4 from the total at the end of Gameweek 8. In the fictional sample, a manager goes from 475 to 667, so the window score is 192. The Teams card can also expand to show the individual rounds and previous windows.

Fewer transfers break ties. I exclude transfers made during a Wildcard or Free Hit gameweek, and two managers who still tie share the same rank. In the sample, two managers score 192 with two counted transfers and share first. A third manager scores 192 with three transfers and ranks third. This configuration scores Gameweeks 1–36 as nine full windows. Scoring reference and sample

Keep scores and progress in SharePoint

The flow keys each result by league, window and manager. That gives it a way to find and update the existing score after a later gameweek. A separate state row records the latest processed gameweek and whether the winners card was announced.

SharePoint and Teams are separate services, which matters when a run fails halfway through. If a Teams post succeeds and the final SharePoint state write fails, the next run can send that card again. I check run history before retrying that case. Once I start a new season, I use a fresh list or reset the old destination so records from the previous season stay out of the new leaderboard. SharePoint schema and keys

Hold the winners card when a fixture moves

A postponed fixture makes the timing less obvious. The flow checks for unfinished fixtures that appear to have moved from their original gameweek and can hold a winners announcement for the affected window. It checks those holds on later runs even if there is no new finished gameweek to score.

Points still count in the gameweek FPL actually assigns them to. The original-gameweek estimate depends on how FPL groups fixture codes. I documented that assumption because anyone reusing the flow needs to know where to look if a postponement produces a surprising result. Fixture rules and operational limits

Try it with a test league

The repo includes a Power Automate import ZIP and the JSON used to build it. Start with a test list and chat, reconnect the SharePoint and Teams actions, enter the classic league ID, and run Flow Checker before enabling the schedule. The workflow uses the premium HTTP action. I checked the package structure locally. A live import and first run depend on your environment and permissions. Deployment guide

You can see the sample standings on the project page.

Keep reading