cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

submit multiple forms

Hi everyone, 

 

I have a bottom with following code:
" SubmitForm(Form1) And SubmitForm(Form2) And SubmitForm(Form3) And UpdateContext({Popup:true}) "

 

I have three forms on one screen. Backend linked to an excel table stored in one drive. 

 

When clicking the bottom, only the first form gets submitted and the text box in either form2 or form3 always have some issue. 

 

Can anyone provide some insights? 

 

Thanks,

JS

 

 

Capture.JPG

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Anonymous,

 

Submit Multiple form is not supported, please check the response from CarlosFigueira in the following thread:

Multiple form submit

Quoted here:

"

Currently this scenario will not work if you have both forms set to the same data source (it should work if you have it set to different data sources, please let me know if this is not the case). When you submit the first form, the data source is refreshed, which causes the item in the second form to be refreshed as well - and the changes that you made are lost.

 

If you have the Item property of both forms set to the same record, then that's expected. If you make changes in one of the forms we do want to update that record everywhere in the app so that it contains the latest changes from the server

 

Even if you have the two forms with different records, it's possible that the change in one of the records will cause a change in the other record (e.g., in a SQL trigger operation), so PowerApps takes the "safe" approach and updates all records bound to that data source in the application, which is why the second form "loses" the changes and therefore there's nothing to be submitted.

"

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
Drrickryp
Super User
Super User

Use a semicolon instead of "and".

Anonymous
Not applicable

Hi @Drrickryp,

 

I've tried that too. Same error in these textboxes.

 

I set textbox value to "required". When i set "required" = false, all three forms get submitted successfully. But text value for form2 and form3 became empty.

 

Felt like when form1 get submitted, textbox for form2 and form3 got cleared. But i did set "reset" option to be false.

 

Don't know what's going on.

Thanks,
JS

 

 

 

Hi @Anonymous,

 

Submit Multiple form is not supported, please check the response from CarlosFigueira in the following thread:

Multiple form submit

Quoted here:

"

Currently this scenario will not work if you have both forms set to the same data source (it should work if you have it set to different data sources, please let me know if this is not the case). When you submit the first form, the data source is refreshed, which causes the item in the second form to be refreshed as well - and the changes that you made are lost.

 

If you have the Item property of both forms set to the same record, then that's expected. If you make changes in one of the forms we do want to update that record everywhere in the app so that it contains the latest changes from the server

 

Even if you have the two forms with different records, it's possible that the change in one of the records will cause a change in the other record (e.g., in a SQL trigger operation), so PowerApps takes the "safe" approach and updates all records bound to that data source in the application, which is why the second form "loses" the changes and therefore there's nothing to be submitted.

"

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thanks @v-micsh-msft

 

I changed each form to a different source and it worked.

 

Many thanks!

Is this still a known issue that you cannot submit multiple forms without using multiple data sources

@StuartSSTech 

 

I have an app that submitts multiple forms to SQL, it works. Currently having an issue when its a new record each form is submitted ans a seperate record, but on editing a record it workds seamlessly.

I found that this answer from @Anonymous here works: 

 

https://powerusers.microsoft.com/t5/General-Discussion/How-to-submit-multiple-forms-at-one-buttom/m-p/99391/highlight/true#M36886

 

Re: How to submit multiple forms at one buttom
 

I have many forms across different screens in my app that I submit to one record in my SQL database. The method I use is. 

Patch('database', Defaults('database'), Form1.Updates, Form2.Updates, Form3.Updates...etc.)

 If there is already a record in the database that I want to modify I search for the ID_Key (Must be a unique key to work) and then patch to that. 

Patch('database',{ID_key:LookUp('database',Name=DataCardValue9.Selected.Value,ID_key)},Form1.Updates, Form2.Updates, Form3.Updates, etc...)

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,922)