cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Phu_Le
Level: Powered On

Set button for attachment (Hide the attachment box)

Hi, please help me those question

1. Can we set a button for active attachment file. (I dont want to show the Attachment Box, because the editor is able to delete the other attached file)

2. Can we set Attachment Box is only accept to attach image file or take a photo from camera. Thanks

Capture3.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Level 10

Re: Set button for attachment (Hide the attachment box)

Hi @Phu_Le ,

1)I'm afraid it's not supported to use a button to attach file to the attachment field currently.

You could only use attachment control to make this.

2)I suggest you set the attachment control's OnRemove property.

Here's my test for your reference:

Set the attachment control's OnAddFile: Set(test,"Yes")

                                               OnRemoveFile Set(test,"No")

Set the submit button's OnSelect: 

If(test="No",Notify("you can't delete attached file",NotificationType.Warning),SubmitForm(Form1))

Then, if you delete the attached file, the form can't be submitted.

What's more, here's a similar idea that posted by other users, you could vote for him:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/Allow-quot-add-only-quot-mode-to-Attachment-cont...

 

 

 

Best regards,

Community Support Team _ Phoebe Liu

1 REPLY 1
v-yutliu-msft
Level 10

Re: Set button for attachment (Hide the attachment box)

Hi @Phu_Le ,

1)I'm afraid it's not supported to use a button to attach file to the attachment field currently.

You could only use attachment control to make this.

2)I suggest you set the attachment control's OnRemove property.

Here's my test for your reference:

Set the attachment control's OnAddFile: Set(test,"Yes")

                                               OnRemoveFile Set(test,"No")

Set the submit button's OnSelect: 

If(test="No",Notify("you can't delete attached file",NotificationType.Warning),SubmitForm(Form1))

Then, if you delete the attached file, the form can't be submitted.

What's more, here's a similar idea that posted by other users, you could vote for him:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/Allow-quot-add-only-quot-mode-to-Attachment-cont...

 

 

 

Best regards,

Community Support Team _ Phoebe Liu