cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ShadowTech
Post Prodigy
Post Prodigy

Alternative thumbnail for image in gallery

Hello,

 

I have a gallery that looks up the attachment field of a form. This is to display the thumbnail images. Everything works with the exception that if A document is attached, no image shows in the gallery for it. How can I substitute with say a PDF image for when the attachment is a PDF document?

 

"If" statement in the image control?

 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @ShadowTech ,

I assume these are attachments you are displaying - if you had images PDFImg, WordImg and XLImg uploaded and anything else was a picture, you would do this

With(
   {
      wExt: 
      Right(
         ThisItem.DisplayName,
         4
      )
   },
   Switch(
      wExt,
      "xlsx",
      XLImg,
      "docx",
      WordImg,
      ".pdf",
      PDFImg,
      ThisItem.Value
   )
)

 

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

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @ShadowTech ,

I do exactly what you are asking on some of my galleries - find a PDF image and upload it to your media, then test for the last three characters of the file name to be PDF and if so display the media image instead of the thumbnail.

 

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 I have images downloaded in the media. I need to replace for .PDF, WORD and Excel.

 

How would that formula look?

 

Thanks in advance.

WarrenBelz
Super User
Super User

Hi @ShadowTech ,

I assume these are attachments you are displaying - if you had images PDFImg, WordImg and XLImg uploaded and anything else was a picture, you would do this

With(
   {
      wExt: 
      Right(
         ThisItem.DisplayName,
         4
      )
   },
   Switch(
      wExt,
      "xlsx",
      XLImg,
      "docx",
      WordImg,
      ".pdf",
      PDFImg,
      ThisItem.Value
   )
)

 

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

WarrenBelz
Super User
Super User

HI @ShadowTech ,

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.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,445)