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
what is in the formula of both the attachment of Form1 and what is the defaults value also.
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!
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
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.