cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Emy
Frequent Visitor

Trouble with Attachment control in PowerApps of Teams

Hi,

 

I'm creating an app in PowerApps of Teams and I am having trouble with Attachment control.

One of the tables in the Dataverse has a column which data type is file. (The maximum size of the file is 32768KB by default)

I prepared the Edit Form which datasource is the table containing the file column.

Then I set the properties of Attachment control as follows.

MaxAttachments=10, MaxAttachmentSize=5.

 

I tried to upload and delete files from the Preview but it did not work as expected.

On the screen, I was able to attach 10 files to the Attachment control, but when I tried to upload them using the SubmitForm function, only the first file was saved.

I checked the file by the Display Form in different screen. (The attached files were all PDF files of about 50-150KB.)

In addition, although I tried deleting the file on the Attachment control by pressing X button on aside and used SubmitForm function, which was successful, the file was not deleted. (the file was still there on the Attachment control.)

 

Is it possible to upload multiple files in PowerApps of Teams (Dataverse)?

Also, how can I delete a file once it is uploaded?

I hope you could help me.

4 REPLIES 4
v-qiaqi-msft
Community Support
Community Support

Hi @Emy,

Do you want to upload multi files to File field in PowerApps for Teams?

Actually, a Dataverse table could have an Attachment field that enables attachments by setting as below.

vqiaqimsft_0-1630380141309.png

However, there is no similar function in PowerApps for Teams. In addition, the File data type field could only upload single file.

In a word, it is impossible to upload multiple files using the File field in PowerApps of Teams (Dataverse).

What do you mean by the file was still there on the Attachment control? I have tested on my side and the it works well, please check if this exists.

Best Regards,
Qi
Emy
Frequent Visitor

Hi,@v-qiaqi-msft,

 

Thank you for replying.

 

Now, I understood why I couldn’t upload multiple files in PowerApps for Teams.

I’m happy to know the reason to the problem.

 

>What do you mean by the file was still there on the Attachment control? I have tested on my side and the it works well, please check if this exists.

 

This means that the File data type field did not return empty.

Here are the steps that I took

 

  1. I saved a single attachment to the File data type field using the SubmitForm function in the Attachment control of the Edit Form.
  2. When I confirmed the same record in the Edit Form, there was the file that I have just saved.

Then I clicked on the X button next to that file name to erase it and updated the record using the SubmitForm function.

 

I thought that this action would delete the attachment and overwrite the File data type field empty.

However, the saved file remained in the File data type field.

 

As a side note, replacing with another file was OK.

(When I clicked on the X button of the Attachment control in the same way that I saved in the File data type field,  and then selected a different file and used SubmitForm function

I was able to overwrite the previous file to another file.)

 

What I want to do is to delete the file once saved in the File data type field and make the field empty.

 

I hope you could advise me.

 

Best Regards

Emy

v-qiaqi-msft
Community Support
Community Support

Hi @Emy,

Do you mean that you have click the x button to delete the attachment but it still exists in the record?

I have a test and the situation is confirmed on my side, yes, the attachment indeed stays when you click the x button. To solve this, I think you should modify the formula you set for the Item property of the form:

LookUp(YourTableName,Name=Gallery1.Selected.Name)// Choose a unique column like Name in my scenario

Click the Gallery to select the record that you want to delete the attachment within, go to the edit form and click the x button to delete the attachment, then click the submit button. 

Check if this could help you.

Best Regards,
Qi
Emy
Frequent Visitor

Hi, @v-qiaqi-msft,

 

Thank you  for your reply again.

 

>Do you mean that you have click the x button to delete the attachment but it still exists in the record?

Yes, that’s what I mean.

 

 I’m afraid, the issue was not solved.

LookUp(YourTableName,Name=Gallery1.Selected.Name)

The above formula had already been set in my form of Item property.

Of course, for “Name”, I set my unique column.

 

Although I clicked the Gallery to select the record that I want to delete the attachment within, then clicked the X button to delete the attachment, and then clicked the submit button, the attachment still existed in the record.

 

I really need your help.

Please give me alternative solution.

Best Regards,

Emy

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,274)