Avatar

<- Back to homepage

New Power Apps PCF arrived: Document Processor

This is a Power Apps Component Framework (PCF) control for fast, local Excel parsing and multi-file drag&drop uploadβ€”no slow SharePoint handoffs or long Power Automate loops. πŸš€

✨ Why this exists

A common Excel parsing workflow: Upload the file to SharePoint β†’ wait for Power Automate to trigger β†’ iterate through a formatted table.

That approach works, but slow, inefficient, and large tables often stall. It doesn’t have to be like that.

This Document Processor PCF extracts tables locally, lightning fast and returns clean JSON you can immediately use in your app or send to downstream Power Automate flows, AI Builder, agents, or other services. βš™οΈ


🧠 What it does

πŸ“Š Excel parsing modes

πŸ“ Fixed Range Mode

  • Parse a specific, predefined cell range (e.g., Sheet1!A1:B2).
  • Optional AutoHeader: Add header to data that doesnt have one

🧱 Fixed Column Mode

  • Provide a starting header range (e.g., Sheet1!B2:Z2). The parser reads columns B β†’ Z starting at row 2, and continues until hit the first blank row.
  • Ideal for standardized templates (e.g., purchase orders with variable row counts).

πŸ”Ž Dynamic Search Mode

  • Scans all worksheets (across multiple files) to detect every table.
  • A β€œtable” = any continuous block of cells with no blank rows or columns interrupting it.

    Originally a tool of my MCP server, this lets you extract all tables and hand them to AI Builder, or your remote agent for deeper analysis and richer context. 🀝

dynamic

Dynamic mode parses all tables across all sheets


🧰 Other features

  • πŸ—‚οΈ Multiple file upload with drag & drop
  • πŸ–±οΈ Enhanced button UX (multi-line caption, icon options)
  • 🧩 Extension limiting to control allowed file types
  • 🎨 Theme inheritance from Power Apps
  • πŸŒ€ Progress spinner and optional secondary text for better feedback
button

πŸ‘¨πŸ»β€πŸ’» Download here:

DocumentProcessor_Managed_1.0.0.zip


πŸ”Œ Params

πŸ”§ Inputs (key properties)

  • Text: Button label.
  • ButtonIcon: Attach | Add document | ArrowUpload.
  • IconStyle: Outline | Filled.
  • ParsingMode: Dynamic | Fixed range | Fixed column.
  • AutoHeader: true | false (use with Fixed Range/Fixed Column when the dataset lacks headers).
  • targetRange:
    • Fixed Range: e.g., Sheet1!A1:B2.
    • Fixed Column: header row span, e.g., Sheet1!B2:Z2.
    • Dynamic: ignored.
  • AllowMultipleFiles: Enable multi-file selection.
  • AllowedFileTypes: Semicolon-separated extensions (e.g., xlsx;xls).
  • AllowDropFiles & AllowDropFilesText: Drag & drop and its hint text.
  • ShowActionSpinner: Show a spinner while processing.
  • ShowSecondaryContent & SecondaryContent: Helper text under the label.
  • Appearance: Primary | Secondary | Outline | Subtle | Transparent.
  • Align: Left | Center | Right | Justify.
  • FontWeight: Bold | Lighter | Normal | Semibold.
  • IconPosition: Before | After.
  • Shape: Rounded | Circular | Square.
  • ButtonSize: Small | Medium | Large.
  • Width / Height / Visible: Layout controls.

πŸ“€ Outputs

  • FilesAsJSON: JSON array of selected files (Base64 and metadata).
  • ExcelOutput: JSON array of parsed table objects for Power Fx or downstream APIs/Agents.

Dependencies & notes

  • targetRange is required in Fixed Range and Fixed Column modes (format differs).
  • targetRange is not used in Dynamic mode.

πŸ–ΌοΈ Base64 output (non-Excel too)

When you upload other file types, the control also returns an array of Base64 strings (one object per file) via FilesAsJSON.
Great for:

  • Sending images to AI Vision models. πŸ‘οΈ
  • Uploading to Blob storage or APIs without extra conversions. ☁️

πŸ” Security & privacy

  • Parsing happens client-side in the app session.
  • Although it was designed to dodge Formula Injection Attacks, you should validate and sanitize sensitive outputs before forwarding them to external services.
  • Use AllowedFileTypes to restrict uploads in sensitive apps.

🏁 Quick start

  1. Import the PCF control into your solution. πŸ“¦
  2. Add the control to your canvas app screen. 🧱
  3. Configure:
    • Choose ParsingMode.
    • Fixed Range: set targetRange like Sheet1!A1:H50.
    • Fixed Column: set targetRange like Sheet1!B2:Z2.
    • Toggle AutoHeader if needed.
  4. Use outputs:
    • Read ExcelOutput for structured tables.
    • Read FilesAsJSON for Base64 content (e.g., AI Vision or storage).

Tuong Doan - All rights reserved.