web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filename extension che...
Power Apps
Answered

Filename extension check fails to detect extension

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

I have the following problem. I want to show only the attachements that have the right extionsion. 

But for some reason this is not working. 

 

Filter(ERA_AEN_AR_dataReceipts.Attachments, Name in [".pdf", ".jpg", ".jpeg", ".png", ".gif"])

 

ERA_AEN_AR_dataReceipts is a FileInputControl. Where users can upload there images/pdfs. 

The control where I do my Filter is the control that will eventually upload the images/pdfs.

 

I have checked if there are files in my ERA_AEN_AR_dataReceipts.Attachments, there is. 

 

 

I hope someone can help me, 

Thanks in advance!

Categories:
  • akandis Profile Picture
    on at

    Hello @Anonymous 

     

    You are using Name field that will come the File name but without extension. There is a field called 'File name with extension' that will return the filename+extension.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @akandis ,

     

    I just checked this and I get the error that 'File name with extension' isn't recognized. I also checked this with ThisItem and ThisRecord but no hit. 

     

    In the image you can see the records from my ERA_AEN_AR_dataReceipts.Attachments control. This is also the reason why I checked on the field 'Name' 

    Schermafbeelding 2022-04-27 om 15.45.35.png

  • Verified answer
    akandis Profile Picture
    on at

    @Anonymous Ohh I see you are saving the blob. Have to tryied to Split by the . and then check the last value?

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @akandis , 

     

    Yes I already have done that but same result... Nothing happend 😕 

     

    I used the following code for it:

    Filter(ERA_AEN_AR_dataReceipts.Attachments, Last(Split(Name,".")).Result in [".pdf", ".jpg", ".jpeg", ".png", ".gif"])

  • Verified answer
    akandis Profile Picture
    on at

    Check without the point["pdf", "jpg", "jpeg", "png", "gif"]. Once you do the split the . will disappear.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @akandis ,

     

    Ooooh woow, I feel like a rookie right now 😅.

     

    Thanks a lot it works perfectly fine right now!!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 432 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard