web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Image Control Equals V...
Power Apps
Unanswered

Image Control Equals Visible if File Extension within is PDF

(0) ShareShare
ReportReport
Posted on by

I am having the worst time trying to get a preview image of any pdf files to show in the same Gallery Image Control as the 'image' files (jpg, png, bmp) in the same library.

 

Consequently, I've determined to try another route.

 

Intent:

1. I have a pdf icon image that I'm going to place in a second image control in the Gallery.

2. I'll overlay the image controls

3. If the file is an image the original control appears with the file preview in it

4. If the file is a pdf the new image control (with the pdf symbol) should appear in it

5. I'd like to do this by file extension, if possible. Is there a way to write a condition that says -

 

     'if Image2.Image file extension = .pdf then visible 'true' else 'false'? 

 

I found this sort condition that uses a similar process; my guess is its possible in some form or fashion, based on the below?

 

SortByColumns( Filter( ProdDocsStructure, Project = projectCode, DefaultFolder = selectedFolder, ParentItem = idParentItem, EndsWith('File name with extension', "pdf") 

Categories:
I have the same question (0)
  • Jim169 Profile Picture
    80 on at

    If you're using a Sharepoint library and the Image is within a gallery then something like this should work within the within the Image property of the image:

     

    If(EndsWith(ThisItem.'File name with extension', ".pdf"), SampleImage,  ThisItem.Thumbnail.Large)

  • Community Power Platform Member Profile Picture
    on at

    I understand.

     

    One twist; the Gallery is getting data from the CQList. The Image Control within the same Gallery is getting the image from the Library based on the below.

     

    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)) ) ).'Link to item'

     

    Is there a way to edit the above for the Image2 control so that control only displays an image if the 'Title' contains "pdf"?

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard