Power Automate: Regex Quick Guide
Power Automate
21. Sept 2025 19:06

Power Automate: Regex Quick Guide

von HubSite 365 über Automate with Deenu

Master dynamic nested JSON in Power Automate with a C# Custom Connector and regex to extract values on GitHub.

Key insights

  • Dynamic JSON: Power Automate flows struggle when JSON structures change or include deep nested arrays, making the built-in Parse JSON action unreliable for many real-world payloads.
  • Custom Connector (C#): The video shows building a C#-based custom connector that applies regular expressions to JSON strings, letting you extract values like attachment names from complex, changing structures; the author also shared the connector's Swagger JSON for reuse on GitHub.
  • Regular Expressions (Regex): Regex gives precise pattern matching for extraction, validation, and replacement, making it ideal to pull specific fields from text-heavy or nested JSON where schema-based parsing fails.
  • Integration into Flows: Add the custom connector to your cloud flow, call its regex endpoint, then map and process the returned values; this avoids repeated schema updates and simplifies extracting items from deep arrays.
  • Alternative Methods: Consider Dataverse low-code plugins using Power Fx functions like IsMatch and Match, Office Scripts (JavaScript regex) called from flows, or Power Automate Desktop’s regex-enabled text actions when a server-side connector is not suitable.
  • Testing & Best Practices: Test with varied sample JSON, add error handling and logging, keep reusable regex patterns, validate inputs for security, and update the connector when new JSON shapes appear to keep flows stable and maintainable.

Overview of the video

In a recent YouTube tutorial, Automate with Deenu addresses a frequent pain point for makers: parsing dynamic, deeply nested JSON inside Power Automate cloud flows. The presenter demonstrates why the built-in Parse JSON action often fails when object shapes change between runs, and he proposes an alternative method that leans on pattern matching. Consequently, the video focuses on a practical, code-enabled workaround rather than a pure low-code solution.


Moreover, Deenu walks viewers through building a Custom Connector implemented in C# that applies Regular Expressions (Regex) to JSON text. He then shows how to wire that connector into a cloud flow to extract values such as attachment names from nested arrays. Finally, he shares a Swagger definition on GitHub and credits earlier work by community authors as the conceptual basis for the approach.


What Automate with Deenu demonstrates

First, the video documents the problem clearly: when JSON schemas shift, Parse JSON requires frequent schema updates and can break flows. Deenu recreates realistic scenarios in which webhooks or third-party APIs return inconsistent structures, and he explains how this variability undermines deterministic schema parsing. As a result, the audience sees the practical limits of relying solely on schema-based parsing in cloud flows.


Next, he builds a connector that accepts raw JSON and runs regex-based extraction to find target values irrespective of nesting changes. The tutorial covers the C# implementation at a high level, how the connector exposes operations via a Swagger file, and how to import and test the connector inside a cloud flow. By walking through an end-to-end flow example, the presenter demonstrates how the connector returns consistent outputs where Parse JSON might fail.


Technical approach and alternatives

Technically, the connector serializes parts of the JSON and applies Regex patterns to capture values rather than relying on structural parsing. This method trades strict schema validation for pattern flexibility, allowing extraction from variable array depths and changing property names. Consequently, regex can recover specific text sequences like filenames or IDs that are otherwise buried in dynamic structures.


However, the video also references other community and platform approaches, such as using Power Fx in Dataverse low-code plugins, invoking Office Scripts to run JavaScript regex in Excel Online, or using paid connectors that include regex features. Each alternative involves tradeoffs: native Power Platform methods reduce external dependencies but might require specific licensing or platform access, while Office Scripts and external connectors can avoid code but add integration complexity or cost.


Tradeoffs and practical challenges

Deenu’s connector-centric solution improves flexibility, yet it introduces governance and maintenance concerns. For example, deploying custom C# connectors typically needs administrative permissions and ongoing code updates, and organizations must review security and compliance before enabling them tenant-wide. Therefore, teams must weigh short-term agility against long-term operational overhead.


Moreover, relying on Regex brings fragility: patterns can break if the text format changes subtly, and overly broad expressions may return false positives. Thus, testing and versioning of regex patterns and Swagger definitions become essential. In many cases, a hybrid strategy—using Parse JSON where the schema is stable and regex-based extraction only when necessary—offers a balanced compromise.


Practical takeaways for automation teams

Practically speaking, the video supplies actionable guidance: start by identifying parts of the payload that truly vary, then scope regex patterns narrowly to minimize unintended matches. Furthermore, Deenu advises maintaining a repository of test payloads and automated checks so you can validate connector updates against real-world examples. Consequently, teams can reduce surprises when flows run in production.


Finally, the tutorial situates the approach in a broader 2025 context where the Power Platform ecosystem has grown more regex-capable through tools like Power Fx and Dataverse plugins, while desktop automation now includes more regex-enabled actions. Ultimately, Automate with Deenu’s video offers a pragmatic, well-documented option for makers who must handle unpredictable JSON, but it also reminds builders to consider security, maintainability, and when to prefer native platform features over custom code.


Power Automate - Power Automate: Regex Quick Guide

Keywords

Power Automate regex,Regular expressions Power Automate,Regex in Power Automate tutorial,Power Automate regex examples,Power Automate extract text regex,Power Automate regex match replace,Power Automate validate email regex,Power Automate advanced expressions