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 III
Super User III

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 III
Super User III

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 III
Super User III

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 III
Super User III

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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,103)