Hi @Ntinos,
Do you add two separated forms within the screen of your app? One form for data from SQL and another form for uploading Attachments?
Do you want to patch the other data along with the attachment files into your SP list data source (insert into same one record)?
Based on the formula that you provided, I think there is something wrong with it. The Patch formula you provided would insert a new record into your SP list, the SubmitForm formula you provided would also insert a new record into your SP list. They are in separated records rather than same record.
I assume that you only enable the Attachments field (Data card) within your AttachmentsForm, I have made a test on my side, please take a try with the following workaround:
Set the OnSelect property of the "Submit" button to following:
SubmitForm(AttachementForm)
Set the OnSuccess property of the AttachmentForm to following:
Patch(
'AVG PowerApp';
LookUp('AVG PowerApp', ID = AttachmentForm.LastSubmit.ID); /* <-- Modify here */
{
ID0: StudentIdLbl.Text;
Comments: CommentsTextInput.Text;
Course: CourseDropdown.Selected.Value;
Student: StudentDropdown.Selected.Value;
Teacher: TeacherLbl2.Text
}
);;
Reset(CommentsTextInput)
Note: I assume that the StudentIdLb1, CommentsTextInput, CourseDropdown, ... etc are all in another form (not the AttachmentForm) which retrieves data from SQL. If the StudentIdLb1, CommentsTextInput, CourseDropdown, ... etc also in the AttachmentForm, please use SubmitForm function to submit your data instead of Patch function.
Best regards,
Kris