cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
prabhavs
Frequent Visitor

File Type Icons to be displayed in gallery

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

2 ACCEPTED SOLUTIONS

Accepted Solutions

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

 

View solution in original post

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.


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,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

View solution in original post

6 REPLIES 6
KrishnaV
Super User
Super User

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.

 


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,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.
v-bofeng-msft
Community Support
Community Support

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

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 ,

 

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.


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,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

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
Kudo Kingpin
Kudo Kingpin

Very nice, thanks!

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,505)