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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (5,830)