cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
JoseC12
Level: Powered On

Submit multiple forms

Good evening,

I have 7 Edit Forms and I want to submit all changes but it doesn't work

7 Edit Forms.jfif

Task List.jfif

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft v-siky-msft
Microsoft

Re: Submit multiple forms

@JoseC12 

I have made a test based on your codes, and it can work properly.

Could you please check if the Update property is correct? could you share it?

 

As an alternative workaround, I suggest you create a gallery to view and edit the 7 values, instead of 7 editform

1. create a horizontal gallery, add a Textinput inside the gallery

2. set Gallery Item property: 

 

Filter(TAREA; SEMANA = Lista_semanas.Selected.NOMBRE && SERVICIO = Gallery_Servicios.Selected.Name)

 

3. set Textinput Default property: ThisItem.'HORAS PLANEADAS' , set DisplayMode property: VarMode

4. add a Edit button, set OnSelect: Set(VarMode,DisplayMode.Edit)

5. add a save button, set OnSelect: 

 

ForAll(RenameColumns(Gallery1.AllItems,"ID","CID"),Patch(TAREA,LookUp(TAREA,ID=CID),{'HORAS PLANEADAS':Value(TextInput1.Text)}));Set(VarMode,DisplayMode.View)

 

StoG_32.gif

Sik

 

View solution in original post

13 REPLIES 13
WarrenBelz
Level 8

Re: Submit multiple forms

Hi @JoseC12 ,

What is the code behind the OnSelect of the Edit and Save buttons?

JoseC12
Level: Powered On

Re: Submit multiple forms

Hi,

EDIT: EditForm(Form_HorasLunes);;EditForm(Form_HorasMartes);;EditForm(Form_HorasMiercoles);;EditForm(Form_HorasJueves);;

EditForm(Form_HorasViernes);;EditForm(Form_HorasSabado);;EditForm(Form_HorasDomingo)

 

SAVE: SubmitForm(Form_HorasLunes);;SubmitForm(Form_HorasMartes);;SubmitForm(Form_HorasMiercoles);;SubmitForm(Form_HorasJueves);;SubmitForm(Form_HorasViernes);;SubmitForm(Form_HorasSabado);;SubmitForm(Form_HorasDomingo);;ViewForm(Form_HorasLunes);;ViewForm(Form_HorasMartes);;ViewForm(Form_HorasMiercoles);;ViewForm(Form_HorasJueves);;ViewForm(Form_HorasViernes);;ViewForm(Form_HorasSabado);;ViewForm(Form_HorasDomingo)

 

When I push Edit button, I able those 7 edit forms to edit. Then when I push SAVE button and I want to submit my changes and then to put in view mode 

WarrenBelz
Level 8

Re: Submit multiple forms

Hi @JoseC12 ,

The first thing you need to do between the SubmitForm and ViewForm is Refresh all your datasets, otherwise you will not see any changes.

If you still have a problem after this, I am happy to work through it with you.

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

JoseC12
Level: Powered On

Re: Submit multiple forms

I put 'Refresh(TAREA)' between all the 'SubmitForms' and 'ViewForm' but nothing happens:

SubmitForm(Form_HorasLunes);;SubmitForm(Form_HorasMartes);;SubmitForm(Form_HorasMiercoles);;SubmitForm(Form_HorasJueves);;SubmitForm(Form_HorasViernes);;SubmitForm(Form_HorasSabado);;SubmitForm(Form_HorasDomingo);;Refresh(TAREA);;ViewForm(Form_HorasLunes);;ViewForm(Form_HorasMartes);;ViewForm(Form_HorasMiercoles);;ViewForm(Form_HorasJueves);;ViewForm(Form_HorasViernes);;ViewForm(Form_HorasSabado);;ViewForm(Form_HorasDomingo)

WarrenBelz
Level 8

Re: Submit multiple forms

Hi @JoseC12 ,

So all of the forms are on the one data source - I was assuming they were on different ones. Firstly, if you refresh between each submit form, it may do the job - if are you trying to write new records on each one, why not simply submit after each one is filled out?

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

JoseC12
Level: Powered On

Re: Submit multiple forms

In those spaces I only want to edit one column of one record. So I have 7 there because I want to edit per week.

GarethPrisk
Level: Powered On

Re: Submit multiple forms

Regardless of the mechanics needed to refresh the data / what is shown on the forms, I recommend that you take advantage of both the Concurrent function, and the Unsaved property of the Forms. For example:

// If needed, to maybe show a 'saving' prompt to allow the forms to submit asyncronously
UpdateContext({locSaved: false});
Concurrent(
    If(
        frmFirst.Unsaved,
        SubmitForm(frmFirst)
    ),
    If(
        frmSecond.Unsaved,
        SubmitForm(frmSecond)
    ),
    If(
        frmThird.Unsaved,
        SubmitForm(frmThird)
    )
);
// Add your logic for refreshing, needed
Refresh(Contacts);
// If needed, to hide a 'saving' prompt
UpdateContext({locSaved: true});

 

This will allow you to only submit changes, instead of submitting all Forms every time. The local variable is optional, to maybe show/hide a saving prompt or to show/hide controls while things process.

Microsoft v-siky-msft
Microsoft

Re: Submit multiple forms

@JoseC12 

I have made a test based on your codes, and it can work properly.

Could you please check if the Update property is correct? could you share it?

 

As an alternative workaround, I suggest you create a gallery to view and edit the 7 values, instead of 7 editform

1. create a horizontal gallery, add a Textinput inside the gallery

2. set Gallery Item property: 

 

Filter(TAREA; SEMANA = Lista_semanas.Selected.NOMBRE && SERVICIO = Gallery_Servicios.Selected.Name)

 

3. set Textinput Default property: ThisItem.'HORAS PLANEADAS' , set DisplayMode property: VarMode

4. add a Edit button, set OnSelect: Set(VarMode,DisplayMode.Edit)

5. add a save button, set OnSelect: 

 

ForAll(RenameColumns(Gallery1.AllItems,"ID","CID"),Patch(TAREA,LookUp(TAREA,ID=CID),{'HORAS PLANEADAS':Value(TextInput1.Text)}));Set(VarMode,DisplayMode.View)

 

StoG_32.gif

Sik

 

View solution in original post

JoseC12
Level: Powered On

Re: Submit multiple forms

Hi, I see it works with you. Where can I find the Update property?

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,649)