CloudNotification & ReportingScheduledPremium connectors

Excel KPI to README Badges File

Weekly schedule reads KPIs from Excel Online and regenerates a metrics.md file via Create Or Update A Repository File so README badges always reflect current numbers.

Members OnlySign in or create a free account to download this solution.

Overview

Pulls KPI rows from a curated Excel Online workbook (SharePoint-hosted) every Monday morning, renders them as a Markdown table with shields.io badge strip, and commits the generated docs/metrics.md back to a GitHub repository using the GitHub REST API via HTTP built-in. README files can ![include](docs/metrics.md) or reference live badges directly.

Broadly reusable — swap the Excel table for any structured data source for a generic regenerate-markdown-on-schedule-and-commit engine.

**State:** Off (Draft)

Use Case

Organizations want README badges to reflect *real* operational numbers — not static shields.io text. This flow pulls KPI rows from Excel Online weekly, renders Markdown badges, and commits to a GitHub repo.

**Key Benefits:** real KPIs in README; reusable pattern for any structured-data → markdown commit; HTTP built-in keeps it on standard licensing (no premium GitHub connector for file writes).

Flow Architecture

Trigger: **Recurrence (Weekly Monday 9:00 AM EST)**.

1. Init 9 variables from env vars
2. Get_KPI_Rows (Excel Online GetItems)
3. Build_Metric_Rows (Select projects each row to Markdown table row)
4. Build_Markdown_Content (Compose) — title, timestamp, badge strip, KPI table, footer
5. Get_Current_Badge_File (HTTP GET /repos/{owner}/{repo}/contents/{path}) — returns SHA if exists
6. Check_If_Badge_File_Exists (If on statusCode == 200, runAfter Succeeded/Failed)
   - True: Update_Existing_Badge_File (HTTP PUT with base64 + SHA)
   - False: Create_New_Badge_File (HTTP PUT with base64 only)

Environment Variables

VariableSchema NameTypeDefaultPurpose
SharePoint Site URLflowlibs_SharePointSiteURLStringhttps://aronhomelab.sharepoint.comRoot SharePoint URL hosting the Excel KPI workbook
Excel KPI File Pathflowlibs_ExcelKpiFilePathString/Shared Documents/FlowLibs - KPI Metrics.xlsxServer-relative path to the workbook
Excel KPI Table Nameflowlibs_ExcelKpiTableNameStringKpiMetricsNamed Excel Table inside the workbook
GitHub Ownerflowlibs_GitHubOwnerStringaronhomelabGitHub org or user
GitHub Repositoryflowlibs_GitHubRepositoryStringflowlibs-demoRepository name
GitHub Badge File Pathflowlibs_GitHubBadgeFilePathStringdocs/metrics.mdRepo-relative path for generated markdown
GitHub Commit Branchflowlibs_GitHubCommitBranchStringmainTarget branch for commits
GitHub Commit Messageflowlibs_GitHubCommitMessageStringchore: regenerate README badge file [automated]Commit message template
GitHub API Tokenflowlibs_GitHubApiTokenSecret(none)GitHub PAT with Contents: Write scope

Connectors & Connections

ConnectorAPI NameConnection FormatUsage
Excel Online (Business)shared_excelonlinebusinessnew_sharedexcelonlinebusiness_fefa5GetItems — read KPI rows
HTTP (built-in)--GitHub REST API — GET + PUT /repos/.../contents/{path}

Customization Guide

1. Set flowlibs_GitHubApiToken to a fine-grained PAT with Contents: Read+Write scope.
2. Point env vars to your workbook (Excel Table must have Metric, Value, Target, Owner columns case-sensitive) and your repo.
3. Adjust schedule recurrence as needed.
4. Enable the flow.

Key Expressions

- @concat('| ', coalesce(item()?['Metric'], ''), ' | ', coalesce(item()?['Value'], ''), ' | ', coalesce(item()?['Target'], ''), ' | ', coalesce(item()?['Owner'], ''), ' |') — Build_Metric_Rows select
- replace(replace(replace(string(body('Build_Metric_Rows')), '"},{"html":"', '\n'), '[{"html":"', ''), '"}]', '') — strip Select JSON wrapper
- GitHub PUT body: {"message":..., "content":"@{base64(outputs('Build_Markdown_Content'))}", "branch":..., "sha":"@{coalesce(body('Get_Current_Badge_File')?['sha'], '')}"}

Excel KPI to README Badges File — FlowLibs | FlowLibs