web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / error catching the pat...
Power Apps
Unanswered

error catching the patch function

(0) ShareShare
ReportReport
Posted on by 13

on my submit button I am using the patch function to populate a SharePoint table.  It works great but I got this error once in about 30 trys.  

SherylNS_0-1701215276858.png

can I wrap the Patch code and all my clear variables in a on error something?  where do I look for the catch error function?

 

Patch(
'MyTab',
Defaults('MyTab'),
{
eMail: User().Email,
Team: {Value: varTeam},
Where: {Value: varWhere},
Date: Now(),
Yield: CounterFSY,
Jaywalking: CounterJ,
Distracted: CounterDD,
Speeding: CounterS,
Vehicles: CounterV,
Pedestrians: CounterP,
Comment: varComment,
TotalObservations:CounterV+CounterP
}
);
Set(varTeam, "");
Set(varWhere,"");
Set(varComment, "");
Set(CounterFSY,0);
Set(CounterJ,0);
Set(CounterDD,0);
Set(CounterS,0);
Set(CounterV,0);
Set(CounterP,0);
Reset(drpTeam);
Reset(drpWhere);
Reset(txtComment);

Categories:
I have the same question (0)
  • SherylNS Profile Picture
    13 on at

    Patch('MyTab',
    Defaults('MyTab'),
    {
    Title: User().Email,
    Team: {Value: varTeam},
    Where: {Value: varWhere},
    Date: Now(),
    Yield: CounterFSY,
    Jaywalking: CounterJ,
    Distracted: CounterDD,
    Speeding: CounterS,
    Vehicles: CounterV,
    Pedestrians: CounterP,
    Comment: varComment,
    TotalObservations:CounterV+CounterP
    }
    );
    If(
    // check if there were any errors when the data was submitted
    !IsEmpty(Errors('MyTab')),
    // if true, show any error message
    Notify(
    "submission failed resubmit",
    NotificationType.Error
    ),
    // else, clear the data
    Set(varTeam, "");
    Set(varWhere,"");
    Set(varComment, "");
    Set(CounterFSY,0);
    Set(CounterJ,0);
    Set(CounterDD,0);
    Set(CounterS,0);
    Set(CounterV,0);
    Set(CounterP,0);
    Reset(drpTeam);
    Reset(drpWhere);
    Reset(txtComment);
    )

     

  • SherylNS Profile Picture
    13 on at

    Will this work??

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 600

#2
WarrenBelz Profile Picture

WarrenBelz 478 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 322

Last 30 days Overall leaderboard