HI,
I have Gallery linked to a sharepoint document library.
I am able to link the Title
I would like to show the File Type icon associated with the file.
I am unable to see the File Type icon in the fields.
How can i get the File Type icon associated with the file?
Thanks
Thanks for posting. I was having issues using a different formula (split) but this worked for me.
If(ThisItem.IsFolder, 'Folder Icon', If(Find("xls",ThisItem.'File name with extension')>0,Excel, If(Find("docx",ThisItem.'File name with extension')>0,Word, If(Find("pptx",ThisItem.'File name with extension')>0,'Power Point', If(Find("onetoc2",ThisItem.'File name with extension')>0,'One Note', If(Find("one",ThisItem.'File name with extension')>0,'One Note', ThisItem.Thumbnail.Small))))))
Now I need to 1) figure out how to get the OneNote file that's showing as a folder to show the right icon and 2) get the file extension without using a split funtion.
This seems easier and better out of all of them. Thanks to all the other solutions
KrishanaV....this was spot on and just what I have been looking for!! Thanks for the great Info!!
https://res-1.cdn.office.net/files/fabric-cdn-prod_20220127.003/assets/item-types/32/ where did you get this link from? should I need to change the link or is it the same because its not working.
Very nice, thanks!
I just created a similar solution but without the need of uploading all the images. Simply make use of the same icons that SharePoint uses.
I've added an image control and then set the Image property to the following:
"https://res-1.cdn.office.net/files/fabric-cdn-prod_20220127.003/assets/item-types/32/" & Last(Split(ThisItem.'File name with extension',".")).Result & ".png"
Hi @prabhavs ,
I am very happy that your issue got resolved and please mark the appropriate reply (which you see helps you) so that the new members of the community.
I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.
Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.
Thanks to both of you.
This is what i did.
I created a document library added a custom column named FileExtnSupported and uploaded the icons.
In my powerapp, i loaded the library into my collection called Mypix.
On the Vertical gallery, on the Image File
LookUp(MyPix,Last(Split(ThisItem.'File name with extension',".")).Result in FileExtnSupported).'{Link}'
This displayed the icons.
Thanks once again,
Prabha
Hi @prabhavs :
First of all ,thanks for @KrishnaV 's solution.
Second,my method is to use switch.I've made a test for your reference:
1\Add a image control into this gallery and set it's Image proprety to:
Switch(
Last(
Split(
ThisItem.'File name with extension',
"."
)
).Result,
"jpg",
"https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3533746924,2513594553&fm=26&gp=0.jpg",
"docx",
"https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=1864127023,980743153&fm=26&gp=0.jpg",
"url",
"https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2796412154,3211657562&fm=26&gp=0.jpg",
"pdf",
"https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=2809522596,2400038798&fm=26&gp=0.jpg"
)
Best Regards,
Bof
Hi @prabhavs ,
That is not supported in PowerApps,the workaround is:
1. Add multiple file icons as part of media gallery in PowerApp
2. In vertical gallery image property write the formula as below:
If(Find("png",ThisItem.'File name with extension')>0,'png-ICON',Find("jpeg",ThisItem.'File name with extension')>0,JPG)
I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.
Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.
WarrenBelz
89
Most Valuable Professional
MS.Ragavendar
58
Michael E. Gernaey
42
Super User 2025 Season 1