How to Convert a PowerPoint PPTX Document to Text in Power Automate
Plain text objects exist in and around the multimedia clutter of PowerPoint files, and we can access that text using just a few clicks in Power Automate.
Specifically, we can use the Cloudmersive Document Conversion connector to convert PowerPoint PPTX files directly to text, removing all accessible text (i.e., not rasterized text in images) from within PPTX file structure.
Why convert PPTX to Text?
This conversion leaves us with a rudimentary plain text object, and we can use that text for a wide range of purposes. We could, for instance, analyze our resulting plain text content with some language model, or we could share that text with collaborators on a project if they’re only interested in the text content of a standard presentation (e.g., a pitch deck).
In this article, we’ll walk through a quick demonstration flow (with screenshots) in Power Automate that uses the Convert PowerPoint PPTX Presentation to Text (txt) action to return a text object from an example PPTX file.
Create an Instant cloud flow
We’ll build an Instant cloud flow in this context — the perfect option for a small-scale test scenario with full control over our input data.
Create a Manual trigger input
To simplify our test, we’ll add a file input in our Manual trigger step that asks flow users to upload a PowerPoint PPTX file.
Incorporate the Cloudmersive PPTX to Text action
In our next step, we’ll add our PowerPoint PPTX to Text conversion action.
We’ll find it by first search for Cloudmersive connectors & locating the Cloudmersive Document Conversion connector (this has a green logo).
We’ll jump to the full actions list by clicking “See more” (opposite the connector name), and from there, we’ll CTRL+F search “Convert PowerPoint PPTX Presentation to Text”.
Create a Cloudmersive Document Conversion connection
We’ll select the highlighted action, and we’ll then create our Cloudmersive API connection. To do that, we’ll need an API key, and we can get one for free by 1) visiting the Cloudmersive website and 2) creating a free account (this will give us a limit of 800 API calls/month and zero additional commitments).
Configure the PPTX to Text conversion
To configure the above request parameters, we’ll pass dynamic content from our Manual trigger action into each respective field.
The top field asks for our file byte string, and the bottom field asks for our file name.
At this point, we’ve asked Power Automate to return a plain text string to our flow containing all the text from our input PPTX file.
Generate a .txt file from the result
In this example flow, we’ll save the resulting text to a plain text file (.txt) in our system using a Create file action.
In the above screenshot, we’ve named our new file using the string “converted to text” + the input file name. We’ve used the slice() function here to trim the .pptx extension from the end of the name (this avoids creating a double-extension file).
We’ve also used the trim() function to remove leading and trailing whitespace from the resulting text object (we’ll likely encounter lots of whitespace when we convert a presentation document to plain text directly).
Test the flow with an example PPTX file
At this point, we’ll save our flow and run a test. That means uploading a test PPTX file from our file system.
When our flow finishes running, we’ll find our new .txt file in our target folder.
This example used a template PowerPoint presentation, and returned the following text:
Text content like this is simple and easy to use in any programmatic workflow!
Conclusion
In this article, we learned how to convert our PowerPoint PPTX documents to plain text using the Cloudmersive Document Conversion connector in Power Automate. We generated a new .txt file with our resulting text in this particular example, but we can build this action into many different types of flows to server a wide range of use-cases.
Be sure to follow this blog for more step-by-step Power Automate walkthroughs!