cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kudo Kingpin
Kudo Kingpin

First Submit on Submit Form Does Not Work

My app will not allow users to submit a change on the first try.

 

For example, if my users try to edit a form, then click submit, no changes will be saved. But if the same user attempts the same edit a second time, the changes will successfully go through. Any subsequent changes made after the initial attempt will work successfully actually. 

 

This error is for all entities connected to this app. As in, no matter which entity the user tries to edit first, it will not submit properly. BUT if a user attempts to edit one entity and then goes to edit a different entity, the second entity will submit properly without issue. For some reason, only the very first edit done in the application will not submit.

 

For each submit I have a button where OnPress = 

Patch(Person, PersonEdit,{

    Name:DataCardValue_PersonEdit_ContactInfo_Name.Text,
    Family_Role: DataCardValue_PersonEdit_ContactInfo_FamilyRole.Selected.Value},
    {Work_Email: DataCardValue_PersonEdit_ContactInfo_WorkEmail.Text,
    Work_Phone: DataCardValue_PersonEdit_ContactInfo_WorkPhone.Text,
    Personal_Email: DataCardValue_PersonEdit_ContactInfo_PersonalEmail.Text,
    US_Mobile_Phone: DataCardValue_PersonEdit_ContactInfo_USMobilePhone.Text,
    Skype: DataCardValue_PersonEdit_ContactInfo_Skype.Text,
    Overseas_Phone: DataCardValue_PersonEdit_ContactInfo_OverseasPhone.Text,
    Vsee: DataCardValue_PersonEdit_ContactInfo_Vsee.Text
});
Refresh(Person);
Navigate('Person - List - Edited Person', None, {PersonList: PersonEdit})

 

In the above example, PersonEdit is a context variable that is equal to a gallery item.

 

All of my forms (except for New Form) use the patch function. I haven't had issues with this until recently. I honestly don't think it's an error that I've created - I've had many issues before where Microsoft just needed to go in and manually fix it. I think this may be another case because I have other apps that do not contain this same issue. 

Any help here would be great. Thanks.

 

1 ACCEPTED SOLUTION

Accepted Solutions

@Meneghino,

I'm not sure if this will help with your case, but I switched all of my data to be stored in a collection and that seemed to fix whatever issue I was having. Just did a simple OnVisible = ClearCollect(NewTableName, DataSource) and then still used the patch function to update my data. Works like a charm.

Hopefully that will help you somewhat. Having an app out for a few weeks doesn't seem like fun. Best of luck!

View solution in original post

3 REPLIES 3
Community Support
Community Support

Hi @TonyHart,

 

So the patch function format should be as below?

Patch(

           DataSource,

           BaseRecord,

           ChangeRecord1,

           ChangeRecord2

          )

Patch(Person, 
         PersonEdit,
        {
         Name: DataCardValue_PersonEdit_ContactInfo_Name.Text,
         Family_Role:
            DataCardValue_PersonEdit_ContactInfo_FamilyRole.Selected.Value
          },
       {
         Work_Email: DataCardValue_PersonEdit_ContactInfo_WorkEmail.Text,
        Work_Phone: DataCardValue_PersonEdit_ContactInfo_WorkPhone.Text,
        Personal_Email: 
            DataCardValue_PersonEdit_ContactInfo_PersonalEmail.Text,
        US_Mobile_Phone: DataCardValue_PersonEdit_ContactInfo_USMobilePhone.Text,
         Skype: DataCardValue_PersonEdit_ContactInfo_Skype.Text,
         Overseas_Phone: DataCardValue_PersonEdit_ContactInfo_OverseasPhone.Text,
          Vsee: DataCardValue_PersonEdit_ContactInfo_Vsee.Text
          }
);

If There are two change record, make sure they both contains the fields required.

For the base record, make sure it has been selected before the Button being pressed.

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Community Champion
Community Champion

Hi all, this has been the case for one of my apps for a few weeks now as well.  And we had changed nothing in the app or data source.

I suspect this is a temporary issue and that it will go away once the new SQL Server connector will be published.

@Meneghino,

I'm not sure if this will help with your case, but I switched all of my data to be stored in a collection and that seemed to fix whatever issue I was having. Just did a simple OnVisible = ClearCollect(NewTableName, DataSource) and then still used the patch function to update my data. Works like a charm.

Hopefully that will help you somewhat. Having an app out for a few weeks doesn't seem like fun. Best of luck!

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (19,610)