
My solution is saving invoices that arrive by email. (to a SharePoint Document Library)
It extracts the Invoice data for processing. (the data is written to SQL 'Invoice_Header'/Detail tables)
On my Processing form, I have a gallery which lists all invoices that have not been processed.
I have used a gallery showing thumbnail.Large versions of the select invoice, but the image is extremely blurry.
So I trying to add a 'PDF viewer' to display the invoice instead. (it is MUCH clearer and the viewer has tools to zoom in/out if the user want to).
For those who are interested : I have followed this article to get the viewer to display the document.
https://www.matthewdevaney.com/power-apps-view-a-pdf-stored-in-a-sharepoint-document-library/
I couldn't get this to work 'natively' (ie: exactly as described above), but I found that if I use a label to pick up the document identifier like this:
Label5.Text = First(Filter(Invoices, ID = Gal_Hdr_LineItems.Selected.Doc_ID)).Identifier
Then I could run the flow using
UpdateContext({varDoc: Get_Doc_Preview.Run(Label5).result});
to return the documents content.
Then set PDF_Viewer.Document=varDoc
That works.
However, when I put "UpdateContext({varDoc: Get_Doc_Preview.Run(Label5).result});" In the gallery's OnSelect statement,
the varDoc does not run every time that a record is selected.
It seems that if I select a record in the gallery (an get the var to update) then the next time that I select a record, the UpdateContext fails. Sometimes, If I click on an object outside the gallery, and then select another item, the var gets updated.
Any thoughts on what is happening here? And how to fix it?
I eventually deleted the gallery and recreated it - Success!