cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FelipeCaru
Level 8

Submitform does not keep data after being submitted/clicked

Hello all,

I am currently testing the app I have made and found a problem I am not sure how to fix. Before getting to that, this is the current structure I have, going from "top" to "bottom":

  1. Home
  2. Project list by name
    • Detail view of item (form view)
  3. Next level of Project: Task (galleryProject.selected.title)
    • Detail view of item (form view)
    • Edit form
  4. Next level: Subtask (galleryTask.selected.title)
    • Detail view of item (form view)
    • Edit form
  5. Final level: Sub Subtask (gallerySubtask.selected.title)
    • Detail view of item (form view)
    • Edit form

orderScreen.png

(5 too has detail and edit)

Now, my problem is that when I am at 'level 5' so to speak, I go to the detail view and then edit, and no problem whatsoever so far. They are coded as:

Detail Form:

LookUp(Consolidado_Piloto_v4,'Nombre Proyecto'=galleryLP.Selected.Nombre_x0020_Proyecto 
&& 'Nombre Tarea'=galleryLT.Selected.Nombre_x0020_Tarea && 'Nombre Subtarea'=galleryST.Selected.Nombre_x0020_Subtarea
&& 'Nombre Sub-Subtarea'=gallerySST.Selected.'Nombre_x0020_Sub-Subtarea')

Go to edit form button:

EditForm(form_ESST);Navigate(editSST, ScreenTransition.Fade)

Edit form:

LookUp(Consolidado_Piloto_v4,'Nombre Proyecto'=galleryLP.Selected.Nombre_x0020_Proyecto 
&& 'Nombre Tarea'=galleryLT.Selected.Nombre_x0020_Tarea && 'Nombre Subtarea'=galleryST.Selected.Nombre_x0020_Subtarea
&& 'Nombre Sub-Subtarea'=gallerySST.Selected.'Nombre_x0020_Sub-Subtarea')

And the save form button:

SubmitForm(form_ESST);Back()

HOWEVER, when I do a change to it and save the form, it takes me to the previous detail form with no data whatsoever. And if I use the "back" button on the detail form, takes me to the gallery of a wrong selected item; in this case, one that has no item in the data. To show in images, the item I am editing is here:

editLevel1.png

With "1" being the project name, then "2" is the gallery selected inside "1" (task) and "3" being the one selected from "2" (subtask).

However, after I save a change to the item I am viewing at that level, first it takes some time to save, the detail form shows nothing, and when I go back to the gallery to see that info of the level, I am at:

editLevel2.png

Which, as seen there, is a totally different place from where I was editing the item. Anyone can help and tell me WHY it is doing this? It will be much appreciated.

 

EDIT:

When I do not do any change whatsoever but use the "ticket" to save changes, it works and takes to correct previous detail form, however it does not when I actually do a change and save it

 

EDIT 2:

This is the screen it shows when saving the edited form:

loadingSaveEdit.png

And then, the detail screen is empty, like if I hadn't previously accesed it and also because at that level there are no items:

emptyDetalleSST.png

 

EDIT 3:

I changed the "save form" button 'OnSelect' to:

SubmitForm(form_ESST)

Without changing any screen, and now I see that after it saves the data it resets all the data and shows nothing on the screen at all.

saveFormChain.png

I think it is because of this that the detail form and then gallery show no information whatsoever.

 

EDIT 4:

Following what I found on the Edit3, I found about the "LastSubmit" property? of the form and I tried to use it, but it seems it does not work? What I did was put on the "OnSucess" of the form:

form_ESST.LastSubmit

and hoped that would keep the records that were submitted instead of leaving me in an empty screen.

 

EDIT 5:

I tried an edit in a level up of the one I was seeing, and after saving an item in the middle of the gallery, when it goes back to the detail screen (Edit - save - navigate/back - Detail screen), instead of showing the info of the middle item I chose, it shows the info of the first item in the gallery. This might be related to what I am having problem with

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Submitform does not keep data after being submitted/clicked

@FelipeCaru 

The issue you are seeing is related to the use of the Selected on the Gallery.

When you Save your form, the data source will change and thus refresh the Gallery.

If you need to have the ability to "maintain state", then consider using a variable on the OnSelect of the Gallery.  Ex. On galleryLP : OnSelect - Set(proyecto, ThisItem)

On galleryST : OnSelect - Set(subTarea, ThisItem)

on gallerySST : OnSelect - Set(subSubTarea, ThisItem)

Then:

 

LookUp(Consolidado_Piloto_v4,'Nombre Proyecto'=proyecto.Nombre_x0020_Proyecto 
&& 'Nombre Tarea'=galleryLT.Selected.Nombre_x0020_Tarea && 'Nombre Subtarea'=subTarea.Nombre_x0020_Subtarea 
&& 'Nombre Sub-Subtarea'=subSubTarea.'Nombre_x0020_Sub-Subtarea')

Depending on the defaults on those galleries and the flow of your app, you might need to adjust to accommodate situations where the item is not selected manually.  But, this is the idea.  And, the reason is, again, because you are updating the datasource to the gallery that is feeding your formula - and when updated, the selected changes.  

 

You can also consider using the variable above in the Default property of the Gallery so that it "keeps" it selected.  

 

Hope that helps give you some ideas.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

2 REPLIES 2
Super User
Super User

Re: Submitform does not keep data after being submitted/clicked

@FelipeCaru 

The issue you are seeing is related to the use of the Selected on the Gallery.

When you Save your form, the data source will change and thus refresh the Gallery.

If you need to have the ability to "maintain state", then consider using a variable on the OnSelect of the Gallery.  Ex. On galleryLP : OnSelect - Set(proyecto, ThisItem)

On galleryST : OnSelect - Set(subTarea, ThisItem)

on gallerySST : OnSelect - Set(subSubTarea, ThisItem)

Then:

 

LookUp(Consolidado_Piloto_v4,'Nombre Proyecto'=proyecto.Nombre_x0020_Proyecto 
&& 'Nombre Tarea'=galleryLT.Selected.Nombre_x0020_Tarea && 'Nombre Subtarea'=subTarea.Nombre_x0020_Subtarea 
&& 'Nombre Sub-Subtarea'=subSubTarea.'Nombre_x0020_Sub-Subtarea')

Depending on the defaults on those galleries and the flow of your app, you might need to adjust to accommodate situations where the item is not selected manually.  But, this is the idea.  And, the reason is, again, because you are updating the datasource to the gallery that is feeding your formula - and when updated, the selected changes.  

 

You can also consider using the variable above in the Default property of the Gallery so that it "keeps" it selected.  

 

Hope that helps give you some ideas.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

FelipeCaru
Level 8

Re: Submitform does not keep data after being submitted/clicked

@RandyHayes 

Thank you so much! That was exactly what I needed, and also had to change a bit the gallery Item for the variable instead of selected, since backtracking left the same problem but with variable did not

Helpful resources

Announcements
thirdimage

Power Automate 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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 319 members 5,510 guests
Please welcome our newest community members: