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 Automate / Powerapps flow to get ...
Power Automate
Answered

Powerapps flow to get PDF file from sharepoint

(0) ShareShare
ReportReport
Posted on by 83

Hello,

 

I want to beable to open a PDF file from a Sharepoint document library within my powerapp. for this to work using Power Automate.

 

I start with a https get Request as trigger and tha i'm trying to get the itemid by using Variable:

 

trigger()['outputs']['queries']['itemid']
 
i want to use the itemid to get the file contact of the pdf file that triggerd the flow.
 
And then i deliver the file contact back to my powerapp.
 
The problem is that 
trigger()['outputs']['queries']['itemid'] is not working i get an error:
Unable to process template language expressions in action 'Initialize_variable' inputs at line '1' and column '2871': 'The template language expression 'trigger()['outputs']['queries']['itemid']' cannot be evaluated because property 'queries' doesn't exist, available properties are 'headers'. Please see https://aka.ms/logicexpressions for usage details.'.
 
hopefully someone knows a better way
Categories:
I have the same question (0)
  • MJain Profile Picture
    2,450 on at

    Hi @icturion ,

     

    queries exist in triggerBody.

    use Compose action to check what is available in queries like this :

    triggerBody()?['queries']
     
    Thanks
  • icturion Profile Picture
    83 on at

    thx for the quick respons.

     

    if i use trigger or triggerbody the only options are:

    - UriPathAndQuery

    - uriQuery

    trigger.JPG

    I got queries from the http get function. 

     

     

  • MJain Profile Picture
    2,450 on at

    Hi @icturion ,

     

    Please provide flow screenshot of initial steps. 

     

    Thanks

  • icturion Profile Picture
    83 on at

    fullflow.JPG

  • icturion Profile Picture
    83 on at

    Hi,

     

    this article does the same steps: https://centricconsulting.com/blog/how-to-use-powerapps-to-view-pdfs-step-2-microsoft-flow_portal/

     

    But this doesn't work.

     

    Maybe someone knows a better way to make the PDF viewer work with pdf that are located in a sharepoint document library.

  • MJain Profile Picture
    2,450 on at

    Hi @icturion ,

     

    itemid is passed from Powerapp and this request should be set as "Get" under Show advanced option. Once you do this it should be working fine.

     

    Thanks 

  • yabela Profile Picture
    53 on at

    Hi, have you managed to solve this, please? Getting the same error with the below flow: 

     

    Screenshot_5.png

     

    Thanks.

  • Verified answer
    icturion Profile Picture
    83 on at

    Hi Yabela,

     

    i got i to work.

     

    This is my powerautomate that i use:

    flow pdf.JPG

     

    This is the code in my PowerApp.

    screen - Onvisible:

    pdateContext({ loading_v: true });;
    UpdateContext({
    pdf_v:
    DocumentophalenPowerAppBHV.Run(
    Concatenate( First( Split( selecteditem_v.Naam; "." ) ).Result; ".pdf" )
    )
    });;
    UpdateContext({ loading_v: false })

     

    PDF viewer - Document:

    pdf_v.pdf

     

     

  • Laur_Adri Profile Picture
    2 on at

    Hi,

     

    The flow you use was working for me for about 2-3 months until yesterday... 

    Did the same happen to you or is yours still working?

     

    Didn't change anything in the code.

  • icturion Profile Picture
    83 on at

    Hi,

     

    For us the flow is still working.

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 594

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 281 Super User 2026 Season 1

Last 30 days Overall leaderboard