web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Trouble passing a URL ...
Power Apps
Unanswered

Trouble passing a URL with '#' through the PDF viewer

(0) ShareShare
ReportReport
Posted on by 119

I am using Power Automate to return a PDF's content from a SharePoint Document Library and display it in a PDF Viewer in Power Apps. The user selects a document from the left-most gallery and it displays in the PDF viewer in the middle of the screen.

powerUser1611_3-1646340705698.png

This flow runs great. It grabs the pdf content from the selected PDF in the Power App and returns it to the PDF viewer, which requires a URL. It then uses that URL to display the PDF in PowerApps. So far so good.

powerUser1611_0-1646340335309.png

 

However, I want users to be able to open the PDF in particular places by selecting one of the 'In This Chapter' gallery items. I am trying to do this using a string like this (the '#' at the end of the URL):

powerUser1611_1-1646340335372.png

The URL opens correctly in the browser, but whenever I pass a URL with '#' through my workflow, however, it returns an error:

powerUser1611_2-1646340335400.png

 

Can anyone explain why this is and how to get around it? Being able to link directly to the section links is a desired feature within the app. I am trying to avoid hard-coding page numbers into the OnSelect property of each item.

 

Thanks!

Categories:
I have the same question (0)
  • BCLS776 Profile Picture
    8,994 Moderator on at

    You can solve this by getting your flow to perform a replace() on the URL string, and replace any '#' with '%23'

     

    Hope that helps,

    Bryan

  • powerUser1611 Profile Picture
    119 on at

    Hi @BCLS776, unfortunately that solution does not work. When # is replaced with %23, the URL returns a 'page not found' error. 

    powerUser1611_0-1646401067280.pngpowerUser1611_1-1646401204509.png

    powerUser1611_2-1646401315628.png

     

     

     

  • beallthings365 Profile Picture
    10 on at

    Hi @powerUser1611 

     

    I was the first person to discover the technique you're using to display PDF files stored in SharePoint libraries in Power Apps 😊

    https://masteroffice365.com/viewing-pdfs-from-sharepoint-within-powerapps/

     

    So firstly - I am glad you find it useful for your app.

     

    That said, I am afraid that is highly improbable that you'll find a solution to your requirements by passing any kind of parameter (i.e # Chapter) to the flow.

     

    The step in the flow uses a SharePoint Get file content using path action that does not understand file type specific parameters such as the # character for PDF documents. Even if it did understand the request the subsequent step in the flow that returns the PDF file to Power Apps would equally fail to return the file in the desired chapter as it won't understand the request either.

     

    That said, you may be able to implement an acceptable workaround if you can identify the page no each chapter in the PDF documents starts on. Before I elaborate on how this might work would this be an acceptable workaround for your solution?

     

    PS: I'm nearly finished with a new blog that details a new never be blogged on / shared before method for displaying PDF files stored in SharePoint libraries in Power Apps 😁.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard