I've been using the following to force Power Apps to end all update files with .jpg.
This works great if user are only uploading new 'image' files.
Unfortunately, I've inherited thousands of pdf files that the client wants the ability to display in Power Apps
Also, most Users have these documents in pdf and don't have license to a version of pdf in which they can convert those files to an image files; and would probably insist that they should be able to upload either.
I currently have the following in my submit button for new items being upload to the SP library. It works fine for image files; however, pdf files (for reason I already know) do not display. I'm going to add an pdf view control to see if it solves my problem.
If I remove the & ".jpg" from the below does that mean all files will upload with whatever file format tag they were created/saved in? I need the field formatting because hundreds of uses will name their files whatever they like; this manages that. How do I ensure both image and pdf can be uploaded to the library and retrieved and viewed again in a Power Apps Gallery.
I can already see the image files. Will removing the .jpg and adding the pdf control and a Gallery with a 'ThisItem' control get me my pdf file to the screen?
Hi @Anonymous :
Q1:If I remove the & ".jpg" from the below does that mean all files will upload with whatever file format tag they were created/saved in?
A:If you remove ".jpg", I am afraid you will not be able to guarantee that the files uploaded by users to the SP library will be created in the correct format.If you are worried about this, you can create a dropdown to let users choose the file format.
Q2:Will removing the .jpg and adding the pdf control and a Gallery with a 'ThisItem' control get me my pdf file to the screen?
A:Sorry, I can't understand what you mean. Could you provide some screenshots and additional instructions?
Best Regards,
Bof
The below Gallery displays images of documents desired to be viewed in the user interface based on the name of the Cert/Qual Title.
This process, as you can see with the test image below, works fine as long as the item coming from the library is an 'image' file. If the member has uploaded a pdf version of the document no image displays in the image control.
How do I get a pdf to display in the Gallery? I am of the understanding a pdf file cannot be displayed in an image control.
The language used to upload items to the library is -
The language being used to return the images from the library is -
Hi @Anonymous :
I noticed that you have obtained the thumbnails of the files in the library.
I have tested that ,the thumbnails of the PDF files can be displayed in the image control.
In addition, I also did a test, the PDFViewer can not be put in the Gallery, so I am afraid there is no other way besides using thumbnails.
Best Regards,
Bof
1. Because of my condition and my flow all of the uploaded document are uploaded and .jpg.
2. I see in your example you have pdf and xlsx. How are you able to upload the different files types.
3. What is the format of your Gallery Condition is it just the name of the library and you get everything? That won't work for this purpose. The current Gallery fields, including the Image control are being populated by a variable (varIsCQRecord) so that the Gallery only populates the records associated with the User.
Hi @Anonymous :
1. Because of my condition and my flow all of the uploaded document are uploaded and .jpg.
If your file has been uploaded to the library, I suggest you can go directly to the library to find the thumbnail as the image property of the image control.
2. I see in your example you have pdf and xlsx. How are you able to upload the different files types.
This is just a template for testing. If you want to know how to upload different types of documents to a library, I think this should be another thread.
3.What is the format of your Gallery Condition is it just the name of the library and you get everything? That won't work for this purpose. The current Gallery fields, including the Image control are being populated by a variable (varIsCQRecord) so that the Gallery only populates the records associated with the User.
I haven't found any description of varIsCQRecord from your post before.Could you tell me how it is defined? As of now, I still don’t understand your situation well. If you need further help or help from other volunteers in the forum, I suggest you elaborate on your situation in an orderly manner.My suggestion at the moment is that you could go directly to the library to find the thumbnail as the image property of the image control.
Best Regards,
Bof
Okay; let's skip the variable.
I went straight the the library using a new Gallery. All of the image files appear. The two pdf files the 'I LITERALLY' just uploaded do no appear in the image control. Here is an example. The first item is a previously uploaded .jpg file. The second item I just uploaded to the library; it was a .pdf file.
I have the following in the Gallery Items to filter for most recent and only items associated with the User, not the entire list or library:
SortByColumns( ForAll( Filter( Distinct( Filter(MemberCertsandQualsList, FullNm=MemberProfileFullNmDropdown.Selected.FullNm ), CQTitle ), !IsBlank(Result) ), With({_filterData: AddColumns( Filter( MemberCertsandQualsList, CQTitle=Result && (DteofCQ>=MemberProfileDatePicker1.SelectedDate) && (DteofCQ<=MemberProfileDatePicker2.SelectedDate) && FullNm=MemberProfileFullNmDropdown.Selected.FullNm ), "stat", If(ComplianceStatus="Noncompliant", 0, 1) ) }, First( Sort(_filterData, DteofCQ, Descending ) ) ) ), "stat", Ascending )
I get this error when I click on the empty image where the pdf should appear.
{"error":{ "code": "generalException", "message": "Substitution Stream found in slot (Original Time: 2021-02-19 03:30:00Z. Format not supported: additional info, e3676f9a-a7d", "innererror": { "code": "SubStreamCached_FormatNotSupported" } }}
I have the following in the image property of the Image control inside the Gallery:
With({_common: ThisItem.CQYr & " " & ThisItem.UnqID & " " & ThisItem.CQTitle & " " & ThisItem.FrstNm & " " & ThisItem.LstNm}, Coalesce( LookUp(CQImageCollection, StartsWith(Title, _common & " " & ThisItem.DteofCQ)), LookUp(CQImageCollection, StartsWith(Title, _common)) ) ).'Thumbnail ({Thumbnail})'.Large
I am using the following (along with the Flow, set to 'UploadedCertsandQuals' List; Content.FileName and Content.FileContent. It is my belief that something in the following is causing my file read error; such as forcing the name of the file, even a pdf file, to include .jpg. It seems to work fine on all the image type file. But I'm not sure.
Here are the files in the library. As you can see the image file (Arrowhead) shows fine in the Thumbnail.
The pdf file (items 2 and 3) do not show any image.
Everything works except the display of the .pdf file.
Hi @Anonymous :
I noticed that the suffixes of your "PDF" files are all ".jpg", can you check whether these "PDF" files can be opened normally?Are they still "PDF" files?
I suggest you use dynamic suffix when creating files by flow, don’t just use ".jpg" as the suffix.
I think this link will help you a lot:
PowerApps Upload File to SharePoint Library
Best Regards,
Bof
Before I get started, my review of the content on the link appear to NOT focus on the file naming convention of the uploaded documents. It is important the naming convention be controlled and the same for each file uploaded. This is why chose the below method. Is there a way to include this naming convention in the 'dynamic' design in the Flow without the .jpg. Can the List column/field names be added in the Flow so that it matches the below out file creation in the library?
User | Count |
---|---|
252 | |
126 | |
104 | |
50 | |
50 |