cat holding laptop computer keyboard

Stop Creating PDFs Manually — Power Apps Can Do This

Last Updated: August 29, 2025By

Creating PDFs manually during software testing can slow down workflows and cause confusion. What if you could generate PDFs automatically right from your Power Apps screen? This post guides you through a real-world example where you produce two distinct PDFs within a software testing tracking app. One PDF captures appended notes with timestamps and user information, while the other documents completed testing steps. Both save directly to a SharePoint document library with automatic tagging for easy management.

This solution combines Power Apps and Power Automate to save time, reduce errors, and keep your audit process clean and organized.

How the Software Testing Tracking App Works

Imagine a team rolling out a new software version and needing end users to test it thoroughly. This app tracks each test across different stages or levels. Testers mark if each step passes or fails and add notes, helping stakeholders follow the testing journey.

Here’s the workflow in brief:

  • Multiple testers perform tests at various stages.
  • The app tracks who did what test and whether it passed or failed.
  • Test names, notes, testers, and timestamps capture essential data to keep records clear.

To archive this data effectively, users wanted PDFs of the appended notes and testing steps. These PDFs become proof points for audits or reviews. The app includes a gallery linked to a SharePoint library where all PDFs are stored and displayed for easy access.

Each PDF shows:

  • Test stage (e.g., “Verify role-based access”)
  • Type (notes or testing details)
  • User who performed the test or created the notes
  • Date and time when it was created

A Cleaner User Experience with a Dynamic Tabbed Menu

Instead of cluttering the screen with empty galleries, the app uses a tabbed menu that reveals PDF galleries only when PDFs exist for that test record. This keeps users focused and avoids confusion from seeing blank spaces.

This approach follows the KISS (Keep It Simple, Stupid) principle—keep the interface straightforward to minimize mistakes and make it easier for testers to find what they need.

When you expand the menu bar, tabs for PDFs appear only if at least one PDF exists. If there are none, the tabs remain hidden. This little detail improves the app’s flow and user satisfaction.

Enable the PDF Viewer in Power Apps Settings

Before generating and viewing PDFs inside Power Apps, you’ll need to enable the experimental PDF viewer control. At the time of this tutorial, this feature is not enabled by default.

To turn on PDF Viewer:

  1. Open Power Apps Studio.
  2. Go to Settings (gear icon).
  3. Select Upcoming features or Preview features (depending on your version).
  4. Find PDF Viewer and toggle it on.
  5. Save and refresh your app session to apply changes.

If you skip this step, your PDF viewer might not appear or work properly.

Behind the Scenes: Button Logic for PDF Generation

Generating PDFs from within Power Apps requires some smart variable handling and container management.

Key Variables Used:

  • varSpinner: Controls showing a spinner GIF during processing to give users feedback that the app is working.
  • varShowNotesFull: Toggles whether the notes section expands to fill the screen for PDF capture.
  • varSoftwareNotesPDF and varSoftwareTestingPDF: Hold the PDF data blobs for notes and testing details respectively.

Spinner for User Feedback

A transparent container with a GIF spinner sits atop the screen. When varSpinner is true, the GIF appears, signaling something is happening. This avoids user frustration wondering if the app froze.

Generating Two PDFs from One Screen

The app uses one screen for generating both PDFs to keep things simple. When the user clicks the Generate Notes PDF button:

  • Set varSpinner to true and varShowNotesFull to true.
  • Call the PDF function, passing in the notes container with expand containers set to true to capture the entire notes section properly.
  • After generating the PDF data blob, reset varShowNotesFull and varSpinner to hide the spinner and restore the screen layout.
  • Navigate to the PDF viewer screen to preview.

When generating the Testing Details PDF from a different gallery:

  • Similar logic runs but targets the gallery holding the completed testing steps.
  • The app grabs the visible gallery data with expand containers enabled for accurate PDF formatting.

Using one screen for both cases reduces complexity, saving you effort on maintaining multiple screens or flows.

Container Layout

The notes and testing details sit inside a vertical container with a horizontal container hosting buttons. This layout determines exactly what appears in the PDF.

The app hides or expands parts of the UI by toggling varShowNotesFull, so the PDF generation captures only the relevant content, ensuring clean PDFs without unnecessary elements.

How the PDF Viewer Screen Works

Because the PDF viewer is still experimental, it must be placed outside all other containers on the screen.

To make the viewer fit well, the app positions it based on the main container’s properties:

  • X and Y coordinates match the main container.
  • Width and Height also mirror the main container’s size, so the viewer fills the designated space perfectly.

The screen uses Power Apps’ new header and footer controls for consistency with the rest of the app.

On the PDF Viewer screen, the back arrow button resets variables like varSoftwareNotesPDF and varSoftwareTestingPDF to blank, then returns users to the main screen.

The PDF viewer dynamically displays either the notes PDF or the testing details PDF based on which variable contains data.

This setup saves time and reduces screen clutter by handling previews in one spot instead of multiple screens.

Automating PDF Saving with Power Automate and SharePoint

Automatically storing generated PDFs in SharePoint solidifies traceability and keeps content organized.

Here’s how the Power Automate flow works:

  • It accepts three inputs from Power Apps: the master ID of the test record, the PDF file content, and the file name.
  • The flow creates a file in the SharePoint document library called testing PDFs, using the provided file name and content.
  • After creating the file, it updates the file’s metadata to include the master ID. This tagging is crucial for tracking PDFs related to specific records.
  • The flow sends a response back to Power Apps confirming success and providing the new file ID.

Power Apps uses this response to confirm the operation, update the UI, and refresh the SharePoint gallery to show the new PDFs.

The flow runs smoothly because the variables and parameters in both Power Apps and Power Automate are clearly named and consistent, making debugging easier.

Naming Your PDFs and Managing Versions

Good file names make archives easy to search. This app uses a dynamic naming system incorporating:

  • Test stage name
  • PDF type (notes or testing steps)
  • Tester name or username
  • Timestamp (date and time)

For example, a file might be named: VerifyRole-BasedAccess_Notes_StephSuperFlof_2023-06-15_14-30.pdf

This naming strategy helps distinguish between versions and keeps files organized by date and user, which is invaluable during audits.

The flow uses these names when saving files in SharePoint, so multiple PDFs from the same stage appear with unique names, reflecting their creation times.

To build similar naming in your app, add variables to capture usernames and timestamps dynamically, and concatenate them into the file name string you pass to Power Automate.

Error Handling and Feedback for PDF Creation

Feedback keeps users confident the process worked. After triggering the flow to save PDFs, the app uses a variable called varPDFCreated to monitor the flow’s success.

If successful:

  • The app shows a confirmation message.
  • It clears all related PDF variables to reset the state.
  • Refreshes the SharePoint gallery to display the new PDF.
  • Navigates the user back to the record’s edit screen.

If the flow fails, the app can alert users, allowing retries or troubleshooting without confusion.

This method keeps the app responsive and transparent so users never wonder if the save worked.

Streamlining Compliance and Auditing with Automation

Automating PDF creation and storage in your testing app is a huge time saver. It reduces manual effort, errors, and helps keep test records clear for audits.

You can customize this approach to fit your IT environment and needs. Expand the idea to approvals, ticketing, or other document-heavy workflows.

If you want the complete downloadable Power App, SharePoint schema, and Power Automate flow to try yourself, join the Steph Marshall Ko-fi community.

Leave A Comment