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

How to submit multiple forms at one buttom

Hello,

 

I have 2 forms in my app called EditForm1 & EditForm 2 

 

On form 2 i have 1 button, i would like to save both forms with that single button.

 

 

But how??

19 REPLIES 19
Brank
Advocate III
Advocate III

In the "OnSelect" property of the Button just do:

"SubmitForm(EditForm1);;SubmitForm(EditForm2)"

 

Of course if those forms are connected in the same data source, it would create 2 records in that data source, if those 2 forms are referred to the same record you should add one and then update that record with the ID created by the data source.

 

Regards,

Anonymous
Not applicable

i used SubmitForm(EditForm1);;SubmitForm(EditForm2) before, but indeed it create 2 records, i would like to have them in one record, what do i have to do to save the forms in the same record.

Anonymous
Not applicable

I'm not a application developer, so i realy dont have any clue of what i have to do right now

Meneghino
Community Champion
Community Champion

Hi @Anonymous

 

I am not a fan of PowerApps forms, have little experience with them so what I suggest may need a little adjusting:

 

SubmitForm(EditForm1);;Patch(YourDataSource; EditForm1.LastSubmit; EditForm2.Updates)

Please let me know what happens.

Anonymous
Not applicable

I tried your code but, i get an unknown error. 

Meneghino
Community Champion
Community Champion

OK, difficult to help further in that case.

As I have mentioned before, please let me know when you are ready to leave forms and use the single controls instead.

@Anonymous did you manage to get round this. am trying to do same thing and been looking.

@Meneghinohow do you mean 'leave forms and use the single controls instead'. i'm new to powerapps and thought everything is forms based.

Meneghino
Community Champion
Community Champion

Hi @d2S

Basically you can use Patch, Update, Remove etc. functions to write to a data source wthout the need for forms.

If you need user input, you can for example use the value of the text of a text input control (say TextInput1) to write a new record in a data source like this:

Patch(MyDataSource, Defaults(MyDataSource), {MyTextField: TextInput1.Text})

You can also include calculated variables based on the current time, etc. etc.

You can find references to all these functions here:

https://powerapps.microsoft.com/en-us/tutorials/formula-reference/

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

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 (2,696)