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 / check attachment name ...
Power Apps
Unanswered

check attachment name before saving the form

(0) ShareShare
ReportReport
Posted on by 30

Hi There,

 

Can I check attachment name while attaching?

I want to avoid the Special characters of attachment file name.

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at

    Hi @Sachin2 ,

    If you are using an Attachment Control, you cannot rename an attachment either while storing it or afterwards. You can however right-click on the file in the Windows dialogue and rename it before selecting for attaching.
    You could however reject it if it contained these characters - first make a Collection (screen OnVisible would be a good place (refer this blog of mine using this modified version for another purpose)

    ClearCollect(
     colChar,
     ForAll(
     Sequence(13),
     {FieldNo: Char(32 + Value)}
     ),
     {FieldNo: Char(47)},
     ForAll(
     Sequence(7),
     {FieldNo: Char(57 + Value)}
     ),
     ForAll(
     Sequence(4),
     {FieldNo: Char(90 + Value)}
     ),
     ForAll(
     Sequence(4),
     {FieldNo: Char(122 + Value)}
     )
    )

    Then on the OnAddFile action of the attachment control

    ForAll(
     colChar,
     If(
     FieldNo in Last(Self.Attachments).Name,
     Notify(
     "Special Characters not alllowed",
     Error
     );
     Reset(Self)
     )
    )

    NOTE: This will delete any other unsaved files you have added before this as well.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard