cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
v-yuxima-msft
Community Support
Community Support

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
v-yuxima-msft
Community Support
Community Support

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

 

Anonymous
Not applicable

This is perfect! Thank you very much! 🙂

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,316)