top of page
Search

HOW TO HAVE MULTIPLE ATTACHMENTS IN ONE FORM USING POWERAPPS

Updated: Feb 15, 2023




A form below is created using a simple sharepoint list which has the following columns[name, email, permanent address, attachments (inbuild column)]



Now two attachment "datacard" has been added by going to “field” property of the form.




If you click on add "field" you can add multiple "datacards" there.



Now, while submission a form, basically what always happens is all the "datafields" inside the "datacards" gets submitted into the list. So, if you submit this form, you will see only one attachment got submitted.




Now to resolve this we will get all the attachments from the attachments controls and we will first remove the "datafields" from both the attachments.




Then we need to add another form inside that screen and have the same "datasource" as the previous form and add another attachment control there(make sure this form is not visible when you publish the changes). Then inside the "items properties" of that attachment control set a collection.



You can create this collection in "onvisible" property of the screen. But for now, creating and collecting the attachments into the collection in "onselect" properties of submit button. Then simply submitting the main form (which is Form1 here). Then we need to patch the 2nd form (which is Form2 here) data by form. updates function, into the same record by using “Form1.LastSubmit.ID”.




Now if you submit the form you will see all the attachments from both the controls are there inside the list and before the form gets reset if you turn on the visibility of the 2nd form, you will see something like this.


This is the submitted list data.


Hope it was helpful for you all.


For further queries or demo please comment below or contact us. For any for consultant/ support work on O365/ development, contact us or visit our website www.sigilotech.com







2,562 views6 comments

6 Comments


what is in the formula of both the attachment of Form1 and what is the defaults value also.

Like

Alicia Lim
Alicia Lim
Dec 31, 2023

hi, thank u! do you happen to know the way to show the two different attachment entries as two different fields when in gallery view? thank u!

Like

Hi, Thanks, I am trying this option but in Onselect code it is mentioned Registrations, but it shows me error in my form, this Registrations, you used for SharePoint name ? Please let me know what I should use on this

Like

Sahil Jhamb
Sahil Jhamb
Jan 31, 2023

Hi,


We can add multiple file attachments in one Attachment control only. So, we need not to add any separate attachment control (2nd Attachment control) for attaching files.

Like
Sahil Jhamb
Sahil Jhamb
Feb 01, 2023
Replying to

I'm curious to understand how to fetch these attachments for edit form and display form and display them in different categories. And it would be better if you mention that this will be useful for particular scenarios where we've category wise attachment option.

Like
bottom of page