First, we need to create a simple form as shown below using the SharePoint list, which has the following columns - Full Name, attachments inbuild column.
Next, we need to add two attachments “datacard” by navigating to the field property of the form shown in the below screen.
By Clicking on fields, we can add multiple “datacards” on the form.
Now, basically, if we submit the form what will happen is all the “datafields” inside the “datacards” get submitted into the list. But you will see only one attachment will get submitted.
To Resolve this issue, we will get all the attachments from the attachments controls, and we need to remove the “datafields” from both attachments as shown in the below screens.
Next, we need to add another form inside the screen connect the same “datasource” as the previous form and add one more attachment control.
we need to set collection to the needed attachment control. Later, we need to hide this form from the screen.
Then simply submit the main form, which is form1. then we need to patch the 2nd form and update the function into the same record by using "Form1.LastSubmit.ID".
ClearCollect(addAttachments, Table());
Collect(addAttachments, DataCardValue8.Attachments, DataCardValue9.Attachments);
SubmitForm(Form1);
Patch(
EmployeeList,
LookUp(EmployeeList, ID = Form1.LastSubmit.ID),
Form2.Updates
);
ResetForm(Form1);
ResetForm(Form2);
ClearCollect(addAttachments, Table());
Now if we submit the form, we will see all the attachments from both the controls are there inside the list and before the form gets reset, you need to turn on the visibility of the 2nd form. You will see something like the below screen.
This Data is finally submitted list.