cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
momureithi
Helper II
Helper II

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

secondImage

Demo Extravaganza is Back!

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

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (64,485)