Showing results for 
Search instead for 
Did you mean: 

Redact sensitive information in a document

Solution Overview



  • SharePoint document libraries hold original and redacted documents.
  • PowerApps provides a friendly user interface to review and select the text to be redacted.
  • PowerAutomate calls an Azure function that redacts the selected text and saves it back to SharePoint.

Get the solution

  • Download the Power Platform solution from GitHub.
  • Update the environment variables to reflect the configuration in your tenant.
  • Deploy the Azure function to a resource group.

Easy to use interface with PowerApps

PowerApps makes the process of viewing and selecting text to redact easy for the user:



  • A list box on the left is populated with documents from a library.
  • The metadata extracted using Microsoft Syntex is displayed on the right.
  • Using the PDF Viewer, users can find text in the document to redact.  Since there isn’t a method to capture highlighted text in the PDF Viewer, a simple right mouse click and copy allows you to paste it in a text box.
  • Clicking the Redact button will send the document and selected text to PowerAutomate where an Azure function is called to redact and return the document.
  • The newly redacted document is added to a document library.


Once the document is redacted, PowerApps displays it to the user.


Azure Function Setup

In your Azure subscription you’ll need to create a new resource group (or use an existing one) that will hold the Azure function.  This will set up all the necessary components you need, specifically the Endpoint to invoke the service and key to authenticate properly.  I created a new resource group on Azure to contain all the components we’ll need.



The URL will be needed in the Power Automate environment parameters as the endpoint for the Azure function.


Power Automate


The core of the solution resides in Power Automate.  Activities can be configured to send the document and selected text to be extracted to the Azure function and then add the redacted document back to the document library, all initiated by the Redact button in PowerApps by the user.



Power Automate core activities


Step by step

Let’s break down each activity in Power Automate to understand what’s going on.

Get the file.


The FileContentID variable is passed from PowerApps and represents the ID of the document the user wants to redact information from.  We’ll use this later in the process.


Initialize and set a variable representing the phrase to redact.  This will be passed from PowerApps representing the text selected by the user.


Using the compose activity in PowerAutomate, it’s critical to convert the content of the file to a base64 binary format.  The Azure function needs this format to process the PDF properly.



A few things to consider when calling the Azure function:

  • The URI is derived from the Azure function endpoint created in the resource group.
  • The selected text that will be redacted in the document needs to have the “redact” name in the body.


Create a new file in SharePoint using the redacted file returned by the Azure Function.



Deploy the Azure function

As part of this solution, I have created an Azure function that will need to be deployed to the resource group created earlier.  Download the Visual Studio solution from GitHub and deploy it to a resource group in Azure.




About the Author
  • Experienced Consultant with a demonstrated history of working in the information technology and services industry. Skilled in Office 365, Azure, SharePoint Online, PowerShell, Nintex, K2, SharePoint Designer workflow automation, PowerApps, Microsoft Flow, PowerShell, Active Directory, Operating Systems, Networking, and JavaScript. Strong consulting professional with a Bachelor of Engineering (B.E.) focused in Information Technology from Mumbai University.
  • I am a Microsoft Business Applications MVP and a Senior Manager at EY. I am a technology enthusiast and problem solver. I work/speak/blog/Vlog on Microsoft technology, including Office 365, Power Apps, Power Automate, SharePoint, and Teams Etc. I am helping global clients on Power Platform adoption and empowering them with Power Platform possibilities, capabilities, and easiness. I am a leader of the Houston Power Platform User Group and Power Automate community superuser. I love traveling , exploring new places, and meeting people from different cultures.
  • Read more about me and my achievements at: MCT | SharePoint, Microsoft 365 and Power Platform Consultant | Contributor on SharePoint StackExchange, MSFT Techcommunity
  • Encodian Owner / Founder - Ex Microsoft Consulting Services - Architect / Developer - 20 years in SharePoint - PowerPlatform Fan
  • Founder of SKILLFUL SARDINE, a company focused on productivity and the Power Platform. You can find me on LinkedIn: and twitter I also write at, so if you want some Power Automate, SharePoint or Power Apps content I'm your guy 🙂
  • I am the Owner/Principal Architect at Don't Pa..Panic Consulting. I've been working in the information technology industry for over 30 years, and have played key roles in several enterprise SharePoint architectural design review, Intranet deployment, application development, and migration projects. I've been a Microsoft Most Valuable Professional (MVP) 15 consecutive years and am also a Microsoft Certified SharePoint Masters (MCSM) since 2013.
  • Big fan of Power Platform technologies and implemented many solutions.
  • Passionate #Programmer #SharePoint #SPFx #M365 #Power Platform| Microsoft MVP | SharePoint StackOverflow, Github, PnP contributor
  • Web site – Youtube channel -