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

Multiple form submit

I have two Edit Forms (Form1 and Form2). I have a button with the onSelect set to SubmitForm(Form2);SubmitForm(Form1),

 

If I make changes in both forms only Form2 will commit the changes. If I make only changes in Form1 then Form1 will commit and the same if I make changes only to Form2. 

 

Can you only submit edits from one form at a time?

1 ACCEPTED SOLUTION

Accepted Solutions
CarlosFigueira
Power Apps
Power Apps

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.

View solution in original post

9 REPLIES 9
CarlosFigueira
Power Apps
Power Apps

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.

View solution in original post

Anonymous
Not applicable

@CarlosFigueiraThank you for the clear explanation...makes total sense. I was using the same datasource due to a layout issue. I dont want any scrolling on my form so I split the view between two forms. Do you know if you can freely arrange the data cards within an Edit Form?

Yes, in the latest version (2.0.650) - and maybe in the previous one, 2.0.640 as well, I'm not sure - you can have multiple columns in an edit form. If you play with the X/Y/Width/Height properties of the cards, you should be able to arrange them as you want.

Anonymous
Not applicable

I was able to accomplish what i needed to do using 12 column approach and removing snap to grid option. 

 

 

Do you happen to know why the following happens?

 

I have one form with 3 dropdowns. The default for all dropdowns is yes and the other option is no. I open my app on two computer browsers at the same time. On computer A I change dropdown 1 to No and leave dropdowns 2 and 3 at yes and click my save button which does a submitform. I wait a couple of minutes an on computer B I am still seeing all dropdowns as Yes since I havent refreshed. I change Computer B I leave dropdown 1 and 3 as Yes and change dropdown 2 to No. When it refreshes it shows dropdown 1 and 2 as no and dropdown 3 as Yes.

The edit form only sends to the server the changes that were made in the fields. When you submitted the form on the first computer, it only sent the change {Field1:No} with the request to the server. The server then updated the record to be {Field1: No, Field2: Yes, Field3: Yes}.

 

Later you changed the field 3 on the second computer and submitted the form. The request to the server only contained {Field2:No}. Therefore the server updated the record to be {Field1:No, Field2:No, Field3:Yes}, which is the delta that was applied to the previous state.

 

As far as I know, PowerApps currently doesn't support something like an 'If-Match' HTTP header which would be used to only update the record if the version in the client is the same version in the server. Please create a new feature request in the PowerApps Ideas page to have support for this scenario.

Anonymous
Not applicable

Ok...that makes sense. I can eliminate the confusion by having all my DDLs default to blank instead of No.

 

So...same scenario with regards to app on Computer A and Computer B. If I update record 1 on Computer A then Computer B doesnt get those updates unless A) they manually refresh or B) if they change that same record then they seem to see the udpates from Computer A. They dont see any update to record 1 if they update record 2. Is this expected? BTW...thanks again for your help. Very informative.

I'm not sure if there's a hard rule regarding which connectors will update all records in scope versus only the record that was updated - I wouldn't be surprised if this was left up to the individual connector to decide. Please create a new thread and hopefully someone that knows more will chime in (many people in the team tend to go through threads that already have an answer).

Anonymous
Not applicable

I will do that...thanks again.

AshishMan
Frequent Visitor

I had tried chaining the submission of forms i.e. 

SubmitForm(Form2) would be inside OnSuccess of Form1. But I used to get ETAG error while submitting the from multiple times.

 

having SubmitForm(Form1); SubmitForm(Form2); on the submit button got rid of the error.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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