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 / File Type Icons to be ...
Power Apps
Answered

File Type Icons to be displayed in gallery

(0) ShareShare
ReportReport
Posted on by 27

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

Categories:
I have the same question (0)
  • KrishnaV Profile Picture
    5,023 on at

    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)

    KrishnaV_0-1594917941579.png


    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.

     

  • v-bofeng-msft Profile Picture
    on at

    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"
    )

     

     

    1.JPG

    Best Regards,

    Bof

  • Verified answer
    prabhavs Profile Picture
    27 on at

    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

     

  • Verified answer
    KrishnaV Profile Picture
    5,023 on at

    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.

  • Community Power Platform Member Profile Picture
    on at

    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"

  • PhilD Profile Picture
    1,011 on at

    Very nice, thanks!

  • SatyajitAaryan Profile Picture
    2 on at

    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.

  • Michael-MWH Profile Picture
    9 on at

    KrishanaV....this was spot on and just what I have been looking for!! Thanks for the great Info!!

  • Pradeep-K Profile Picture
    3 on at

    This seems easier and better out of all of them. Thanks to all the other solutions

  • damian_green23 Profile Picture
    274 on at

    Thanks for posting.  I was having issues using a different formula (split) but this worked for me.

    damian_green23_1-1708283360620.png

    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.

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 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard