cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jlivio
Regular Visitor

PDF Viewer with a criteria

Hi all, I have a flow to show a PDF file in the PDF Viewer control and updating context to run the flow from a gallery, so my parameter is the Selectd."Name and Extension", runs fine

pdf.png

The problem is I want to display a PDF based on an INVOICE NUMBER in the document list. I´m running out of ideas, anyone have one or point me to the right direction?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @jlivio ,

If you have the item you want in a gallery as I mentioned below, (but simply Filtered on InvoiceID) you can open it).
You could also do a Lookup

With(
   {
      wFile:
      LookUp(
         YourLibrary,
         Invoice = ThisItem.InvoiceID
      )
   },
   Set(
   ViewPDF,
   PDFView.Run(
      varSite,
      "/" & wFile.'Folder path' & wFile.'File name with extension'
   )
)   

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

7 REPLIES 7
WarrenBelz
Super User
Super User

Hi @jlivio ,

Assuming your have the Invoice number in the metadata of the library, the design of an app I have may assist.

I have a gallery based on a Library (yours could be filtering the Library on the Invoice number) and I display a Thumbnail of the document in this

ThisItem.'Thumbnail ({Thumbnail})'.Large

 

PDFManuals.png

The top icon then launches the document in the viewer.
Firstly varSite is simply the base site address then this

Set(
   ViewPDF,
   PDFView.Run(
      varSite,
      "/" & ThisItem.'Folder path' & ThisItem.'File name with extension' 
   )
)

the Document of the view is

varPDF.pdf

and the Flow is simply this

 

PDFFlow.png

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

WarrenBelz
Super User
Super User

Hi @jlivio ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

HI, Thanks, but the list don't have the data source for the document library, only a Invoice ID and an ID, so it must be done in the Flow side, any clues?

 

Thanks

Hi @jlivio ,

I have not tried this, but you could use "Get file content" instead of using the path and filter for the Invoice number in the relevant metadata field

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

WarrenBelz
Super User
Super User

Hi @jlivio ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Hi, Thanks, the problem is this:

 

LIST 1

Document List

FileReaf

InvoiceID

LIST 2

InvoiceID

Generic List

PROBLEM

Display the document in a PDFViwer Control by using the InvoiceID in the context of LIST 2, the Data Source available is LIST 2, so you don´t have the document available from LIST 1, It means you only can do this in a FLOW filtering this InvoiceID to give you the right PDF File from LIST 1.

 

Looks easy but it's NOT.

Hi @jlivio ,

If you have the item you want in a gallery as I mentioned below, (but simply Filtered on InvoiceID) you can open it).
You could also do a Lookup

With(
   {
      wFile:
      LookUp(
         YourLibrary,
         Invoice = ThisItem.InvoiceID
      )
   },
   Set(
   ViewPDF,
   PDFView.Run(
      varSite,
      "/" & wFile.'Folder path' & wFile.'File name with extension'
   )
)   

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,561)