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

submit multiple forms - unexpected behaviour

So I have a canvas app with a gallery and forms across a number of screens.

From the gallery screen, the user can create a new entry or select from an existing entry.

On the first screen, there are two forms - one which is just for the user's details (UserDetailsForm) and one for details of their workstation (WorkstationDetailsForm). If they have previously added their own details, the UserDetailsForm pre-populates with them. Otherwise, this is a new form as is the WorkstationDetailsForm. On this screen there is a submit button which submits both forms (using SubmitForm function). The Item property of WorkstationDetailsForm is set to the selected gallery.

 

There are then another 8 screens with forms connected to the same data source as the WorkstationDetailsForm. For these forms, I have used a Patch function referencing the record as WorkstationDetailsForm.LastSubmit and the currentform.Updates. The Item property of these forms are set to WorkstationDetailsForm.LastSubmit and the default mode is If(IsBlank(WorkstationsGallery.Selected), FormMode.New, Edit).

 

There are also navigation buttons on the form which allows the user to move forwards/backwards through screens if they've already saved those details. The OnSelect has a SubmitForm for all the forms.

 

There are two issues I'm having when testing this.

1. When opening the app for the first time, the item I select in the gallery tends to default to the item in the gallery which was last submitted rather than the one I selected. If I go back to the gallery and try again, it usually does go to the selected gallery item. This issue doesn't tend to occur in the studio preview.

 

2. Occasionally when the form is submitted (be this the workstation gallery on the second screen, or when navigating between screens), the form reverts to a previously submitted form. Sometimes this is just on the form that has been submitted, but sometimes the next form displays the wrong item as well. I've tried this a number of times, either changing the details before submitting or not changing the details at all and there is no consistency as to when this occurs. 

 

Any help or advice as to what could be going on here is appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
calvares
Level 8

Re: submit multiple forms - unexpected behaviour

This bug seems to be fixed for us now.

View solution in original post

6 REPLIES 6
Super User
Super User

Re: submit multiple forms - unexpected behaviour

@calvares 

Have you considered making all of your Forms the same Item from the Gallery?

i.e.  WorkstationsGallery.Selected

I'm confused as to why you would have Patch functions and a SubmitForm...is there any particular reason for that?  Typically in this scenario you would use one over the other.  Especially if you are doing all the forms at once.

Also, how is that IsBlank(WorkstationsGallery.Selected) working out for you??  Typically there is always something selected in the Gallery unless you are doing something to override the Default.

_____________________________________________________________________________________
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.
calvares
Level 8

Re: submit multiple forms - unexpected behaviour

Hi @RandyHayes 

 

Thanks for the advice. I think I used a Patch as I thought it might submit the forms as new, but having the right display mode should take care of that. I've switched those to SubmitForm now.

 

The idea of IsBlank(WorkstationsGallery.Selected) would be that if nothing was selected from the gallery i.e the user clicked on the add new button, then they would get a new form. I've also updated the DefaultMode condition so it's based on a variable (newworkstation = "true") set when the new button is clicked.

 

However, neither of these updates have resolved the issues. 

Issue 1. surely must be a bug if it always selects the wrong gallery item the first time round but never with subsequent attempts?

Super User
Super User

Re: submit multiple forms - unexpected behaviour

@calvares 

So, as far as I know, there is no concept of nothing selected in a gallery.  There is always something that is going to be there, unless you specifically set a default of nothing.

 

But now, you say:

When opening the app for the first time, the item I select in the gallery tends to default to the item in the gallery which was last submitted rather than the one I selected. If I go back to the gallery and try again, it usually does go to the selected gallery item. This issue doesn't tend to occur in the studio preview.

 

So, the gallery will usually default to the first item, unless you are changing the Default property.   I'm a little confused on the "the item I select in the gallery tends to default..."  This is not clear - if you are selecting the item in the gallery, what would default have to do with it?  Default is usually about what is selected by default, not about what you select manually.  

 

_____________________________________________________________________________________
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.
calvares
Level 8

Re: submit multiple forms - unexpected behaviour

Hi @RandyHayes 

 

So, as far as I know, there is no concept of nothing selected in a gallery.  There is always something that is going to be there, unless you specifically set a default of nothing.

OK that is good to know, thanks.

 

So, the gallery will usually default to the first item, unless you are changing the Default property.   I'm a little confused on the "the item I select in the gallery tends to default..."

I think we have misunderstood each other here. I wasn't referring to the Default property but what behaviour occurs.

 

It does actually look like this is a bug that Microsoft are aware of. Whether this bug has anything to do with my second issue, I am not sure. I will do some more testing next week and see if anything has changed.

Super User
Super User

Re: submit multiple forms - unexpected behaviour

@calvares 

Ah yes, that makes more sense now that I read the other post as well. I am glad it is an acknowledged bug and has a fix coming.

_____________________________________________________________________________________
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.
calvares
Level 8

Re: submit multiple forms - unexpected behaviour

This bug seems to be fixed for us now.

View solution in original post

Helpful resources

Announcements
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 Kudoed Authors (Last 30 Days)
Users online (4,224)