cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JoseC12
Helper V
Helper V

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
v-siky-msft
Community Support
Community Support

@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
Super User III
Super User III

Hi @JoseC12 ,

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

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 

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.

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)

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.

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

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.

v-siky-msft
Community Support
Community Support

@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

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

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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (79,550)