Hi all,
I'm hopiong you can help me out.
I have created an app with some fileds which take their data from SQL and one form in order to attache a file. I have created a button to save all these to SharePoint with patch and submit form, but my problem is that the submitForm doesn't work.
I've used this as the onselect:
Patch(
'AVG PowerApp';
Defaults('AVG PowerApp');
{
ID0: StudentIdLbl.Text;
Comments: CommentsTextInput.Text;
Course: CourseDropdown.Selected.Value;
Student: StudentDropdown.Selected.Value;
Teacher: TeacherLbl2.Text
}
);;
SubmitForm(AttachementForm);;
Reset(CommentsTextInput)
At the attached file you can see the picture from my app for better understanding.
How i can combine at the same button the submitform for attachement and the patch for the other data ?
Thank you in advance.
Solved! Go to Solution.
Hi @v-xida-msft,
Finally, i choose to insert all the data to one Form and use at the submit button at OnSelect the SubmitForm in order to send them all at SP with one record.
I was looking for another solution that would send the data more quickly, but now i am ok.
Thank you very much.
Hi @Ntinos,
It sounds like you want both SubmitForm and Patch to run at the same time. You can use Concurrent() to make them simultaneous:
Concurrent( Patch( 'AVG PowerApp'; Defaults('AVG PowerApp'); { ID0: StudentIdLbl.Text; Comments: CommentsTextInput.Text; Course: CourseDropdown.Selected.Value; Student: StudentDropdown.Selected.Value; Teacher: TeacherLbl2.Text } ); SubmitForm(AttachementForm) );; Reset(CommentsTextInput)
But I am wondering--is the Form in new mode or edit mode? Can you share more about that setup?
You have understood right!
I will try your code and i will inform you.
Also the powerapp that i have created is custom. Meaning that as you can see from the picture i have the "AttachementForm" which is connected to SP and i have separated some dropdowns,labels and one textbox which take their data from SQL. All these data i tried to save them every time at SP with one button.
If you need to send you any other information please tell me.
Hello,
I tried it and the code create two separate raws at SP. The first raw contains only the attache file and the second raw contains only the data from other fields(labels,drobdowns etc) without the attache file.
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
Hi @v-xida-msft,
Finally, i choose to insert all the data to one Form and use at the submit button at OnSelect the SubmitForm in order to send them all at SP with one record.
I was looking for another solution that would send the data more quickly, but now i am ok.
Thank you very much.
User | Count |
---|---|
184 | |
124 | |
90 | |
45 | |
43 |
User | Count |
---|---|
267 | |
160 | |
128 | |
81 | |
75 |