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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Power App view pdf fil...
Power Apps
Answered

Power App view pdf file returned from GET request to REST API

(0) ShareShare
ReportReport
Posted on by 40

I'm trying to display a pdf recovered using a GET request to a RESTful API in the Power Apps Pdf Viewer.

 

I've created a customer connector for the GET request which returns a pdf in the response body. I can see this API call is works fine in the test mode of the customer connector ( as well as in Postman).

 

I don't know a way of getting to the response body of the connector call in Power Apps so I've created a Power Automate flow to call the API and return the pdf in file type response property of a "Respond to Power App or Flow" action (see below).

 

I then call the flow from an OnSelect event of a Power App button and use UpdateContext to assign the response to a local variable.

 

I'd rather hoped that simply assigning the document property of the pdf viewer to the local variable but alas not. The api appears to call ok (Power Apps seems to think for a few secs) but the pdf viewer doesn't display the file and no error messages appear.  

 

Can anyone advise how I can get the pdf response of my API call to display in the Power App pdf viewer please?

 

Thank you

 

Jonathan

 

 

flow.jgp.JPG

I have the same question (0)
  • Verified answer
    basa314 Profile Picture
    40 on at

    Now solved.

     

    Created a customer connector which I called from Automate and base64 encoded the pdf in the response body into a variable string using  base64(outputs('report')?['body'])  Then returned the string to Power Apps  with "data:application / pdf;base64," as a prefix.

     

    Calling the Automate flow from Power Apps and assigning the return string to the document property of the Pdfviewer2 displayed the pdf.

     

     

     

  • drombley Profile Picture
    7 on at

    Hi @basa314 

     

    Can you show me how you solved this?

     

    regards,

     

    drombley

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 70

#2
WarrenBelz Profile Picture

WarrenBelz 64 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 36 Super User 2026 Season 1

Last 30 days Overall leaderboard