cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate I
Advocate I

PowerApps · Enforce File Type on the Attachment Control

Hello,

 

I would like to enforce the attaching of PDF files only, on the attachment control on my form.

 

Anyone who can help with this?

 

Thanks,

Mo'

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: PowerApps · Enforce File Type on the Attachment Control

Hi @momureithi ,

Put this on the OnAddFile of the Attachment Control

If(
    Right(
        Last(Self.Attachments).Name,
        3
    ) <> "pdf",
    Notify(
        "You can only attach PDF files",
        NotificationType.Error
    );
    Reset(Self)
)

 

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.

View solution in original post

2 REPLIES 2
Highlighted
Super User
Super User

Re: PowerApps · Enforce File Type on the Attachment Control

Hi @momureithi ,

Put this on the OnAddFile of the Attachment Control

If(
    Right(
        Last(Self.Attachments).Name,
        3
    ) <> "pdf",
    Notify(
        "You can only attach PDF files",
        NotificationType.Error
    );
    Reset(Self)
)

 

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.

View solution in original post

Highlighted
Advocate I
Advocate I

Re: PowerApps · Enforce File Type on the Attachment Control

Hello @WarrenBelz,

 

This has really helped. Thank you! 👍

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,261)