cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lmpbcps
Level: Powered On

Display different images in gallery based on document type

Hello!

I have a gallery with an image control. The gallery contains names of documents that are PDFs or DOCX. If the document's extension ends in .pdf, I want the image to display a PDF icon and if the document extension ends in .docx, display a word document icon. Any idea what the formula for the image would be??

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Display different images in gallery based on document type

Hi @lmpbcps 

 

For the image control within the gallery

 

Set the Image property as

 

If(EndsWith(ThisItem.'File name with extension',".docx"),imagefordocx,If(EndsWith(ThisItem.'File name with extension',".pdf"),imageforpdf, defaultimage))

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

 

View solution in original post

1 REPLY 1
Dual Super User
Dual Super User

Re: Display different images in gallery based on document type

Hi @lmpbcps 

 

For the image control within the gallery

 

Set the Image property as

 

If(EndsWith(ThisItem.'File name with extension',".docx"),imagefordocx,If(EndsWith(ThisItem.'File name with extension',".pdf"),imageforpdf, defaultimage))

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

 

View solution in original post

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,608)