cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Restrict Attachment Type

Hi all,

I am making an accident reporting app for company stores/Health and Safety. If an accident happens on site the injured party, any witnesses, and the manager of that store fill in the form and the manager then submits it. The data is populated into a SharePoint list. The manager can attach files, or supporting documents, using the Attachment Control which are then stored in the list with the item. 

 

Is there a way in PowerApps to restrict/prevent the user from attaching or submitting certain file types, e.g. executable files? I have tried this solution but to no avail.

 

Many thanks.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Restrict Attachment Type

Hi @Anonymous 

 

Do you want to restrict user to submit the attachment type?

I think you can try the following workaround,I test as next:

 

Add one label and rename it as LabelWarning,

Label.Warning.Text="There is jpg file in attachment,and you aren't permitted to submit thie type,please try again!"

Label.Warning.Visible=If(".jpg" in Concat(DataCardValue6.Attachments.Name,Name&","),true)   

LabelWarning.Color=Red                                                        (I try to restric .jpg attachment type file)

IconAccept1.Visible=!LabelWarning.Visible 

IconAccept1.OnSelect=SubmitForm(EditForm1)

restrictattachmenttype1.PNG

 

Then check:

RestrictType.gif

 

Hope this workaround could be helpful.

 

Best Regards.

Yumia

 

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: Restrict Attachment Type

Hi @Anonymous 

 

Do you want to restrict user to submit the attachment type?

I think you can try the following workaround,I test as next:

 

Add one label and rename it as LabelWarning,

Label.Warning.Text="There is jpg file in attachment,and you aren't permitted to submit thie type,please try again!"

Label.Warning.Visible=If(".jpg" in Concat(DataCardValue6.Attachments.Name,Name&","),true)   

LabelWarning.Color=Red                                                        (I try to restric .jpg attachment type file)

IconAccept1.Visible=!LabelWarning.Visible 

IconAccept1.OnSelect=SubmitForm(EditForm1)

restrictattachmenttype1.PNG

 

Then check:

RestrictType.gif

 

Hope this workaround could be helpful.

 

Best Regards.

Yumia

 

View solution in original post

Anonymous
Not applicable

Re: Restrict Attachment Type

This is perfect! Thank you very much! 🙂

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,585)