cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
momureithi
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
WarrenBelz
Super User III
Super User III

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

5 REPLIES 5
WarrenBelz
Super User III
Super User III

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

Hello @WarrenBelz,

 

This has really helped. Thank you! 👍

@WarrenBelz , Can you please suggest the formula to accept .pdf,.xls and .doc files?

@SumanthDundi7 ,

You just need to add them

<> "pdf" || <> "doc" || <> "xls"

 

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.

Thank you @WarrenBelz 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

Top Solution Authors
Top Kudoed Authors
Users online (47,095)