cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JS_808
New Member

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 @JS_808,

 

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 II
Super User II

Use a semicolon instead of "and".

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 @JS_808,

 

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

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 @Jcole429 here works: 

 

https://powerusers.microsoft.com/t5/General-Discussion/How-to-submit-multiple-forms-at-one-buttom/m-...

 

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors
Users online (2,547)