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

Having multiple attachment fields in Canvas app

Hello all, 

 

I am building a canvas app, which should allow to attach multiple documents, and using attachment control to achieve that. However, I wondered if it is possible to include multiple attachment controls to indicate what kind of documents should be attached. Example user scenario:

 

1. User finds attachment control1 and attaches a few photos;

2. Then user find attachment control2. In attachment control2, attached photos are hidden and user attaches a PDF document;

3. Attachment control2 shows that a PDF was attached, while attachment control1 shows that a few photos were attached;

3. User clicks to submit the form and all attachments are uploaded to the SharePoint list.


I am trying to use Items function in the attachment control2  to try to hide attached files attachment control1, but no luck so far -it seems I can only use Items = Parent.Default , which will show all attached items. would sincerely appreciate the advice, whether it is possible to have several attachments controls and only show items that were attached in each individual attachment control..

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @Anonymous ,

You cannot have more than one Attachment field on a list. You could put in multiple controls, but they will all show (and attach)  the same files.

 

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

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @Anonymous ,

You cannot have more than one Attachment field on a list. You could put in multiple controls, but they will all show (and attach)  the same files.

 

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.

Anonymous
Not applicable

Hi @WarrenBelz , 

Noted. Do I understand correctly that is also not possible to have an Attachment field in two canvas app forms and then upload files from each Attachment field to the SharePoint list?

 

My attachment fields:

form1.pngform2.png

I have done two tests with Patch formulas. 

1. Used formula: Patch(MT, MT_form1.LastSubmit, MT_Form2.Updates)

Result: files from both attachments fields appear in Form1. Attachment field in Form2 appears empty.
resultform1.png

2. Used formula: Patch(MT, Defaults(MT), MT_Form2.Updates)

Result: Two SharePoint list items are created and each item includes a single attached file in Form1.


I guess Patch(MT, MT_form1.LastSubmit, MT_Form2.Updates) would be the most "user-friendly" solution if the objective is to upload attachments from several Attachment forms. Perhaps, there could be any improvements done?

Hi @Anonymous ,

Your first example attaches to an existing record as you have used the last submitted record on Form 1 and if there was already an attachment, this would add to it. 

The second creates a new record, so it will be the only attachment. The filed may be empty as the data source may not have refreshed.

Is this what you are asking?

 

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.

Anonymous
Not applicable

Hi @WarrenBelz , 

Yes. Thank you for the clarification!

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,208)