Skip to main content

Notifications

Community site session details

Community site session details

Session Id : ca3BDHA7EBXM6/OT0OeeFX
Power Apps - Building Power Apps
Answered

File Type Icons to be displayed in gallery

Like (0) ShareShare
ReportReport
Posted on 16 Jul 2020 15:29:53 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:
  • damian_green23 Profile Picture
    274 on 18 Feb 2024 at 19:11:12
    Re: File Type Icons to be displayed in gallery

    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.

  • Pradeep-K Profile Picture
    3 on 10 Oct 2023 at 19:10:33
    Re: File Type Icons to be displayed in gallery

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

  • Michael-MWH Profile Picture
    9 on 27 Mar 2023 at 22:47:30
    Re: File Type Icons to be displayed in gallery

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

  • SatyajitAaryan Profile Picture
    2 on 27 Mar 2023 at 11:55:10
    Re: File Type Icons to be displayed in gallery

    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.

  • PhilD Profile Picture
    1,009 on 30 Apr 2022 at 23:16:09
    Re: File Type Icons to be displayed in gallery

    Very nice, thanks!

  • Community Power Platform Member Profile Picture
    on 01 Apr 2022 at 09:48:02
    Re: File Type Icons to be displayed in gallery

    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"

  • Verified answer
    KrishnaV Profile Picture
    5,023 on 17 Jul 2020 at 14:46:27
    Re: File Type Icons to be displayed in gallery

    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.

  • Verified answer
    prabhavs Profile Picture
    27 on 17 Jul 2020 at 13:00:32
    Re: File Type Icons to be displayed in gallery

    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

     

  • v-bofeng-msft Profile Picture
    on 17 Jul 2020 at 02:33:35
    Re: File Type Icons to be displayed in gallery

    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

  • KrishnaV Profile Picture
    5,023 on 16 Jul 2020 at 16:46:01
    Re: File Type Icons to be displayed in gallery

    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.

     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 89 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 58

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 42 Super User 2025 Season 1

Overall leaderboard
Loading started