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 / IfError not working wi...
Power Apps
Answered

IfError not working with Patch

(0) ShareShare
ReportReport
Posted on by 23

Hello,

 

I have 2 questions about the feature IfError():
1st one: can you confirm that, even it's still an experimental feature,  IfError() won't be deprecated in the future, but it's still an experimental feature as you are working on its improvement? 

 

2nd one: I try to implement it when inserting/updating a Sharepoint list with Patch().
I tried to test it by Patching a new item with one required field empty, but it failed:
the IfError() doesn't work and the item is registered in the list with the mandatory field empty.

Is there any additional configuration we must do on the Sharepoint list?

The code is basic:

IfError(Patch(table1,Defaults(table1),{....})

    , [...sending email with error detail...]

    ) 

 

Many thanks in advance for your help,

Categories:
I have the same question (0)
  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @SabineR 

     

    Here is the same one for Error handling

     

    Patch(
     'Test Scores',
     Defaults('Test Scores'),
     {
     TestName: txt_TestName.Text
     }
     );
     If(
     !IsEmpty(Errors('Test Scores')),
     Notify(
     Concat(Errors('Test Scores'), Column&": "&Message),
     NotificationType.Error
     ),
     Navigate('Success Screen');
     )

     

     Note: You can update yours. Instead of notification, we can send an email.

     

  • Verified answer
    StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @SabineR 

     

    Sending email if any error

     

    Patch(
     'DataSource',
     Defaults('DataSource'),
     {
     TestName: "Test"
     }
     );
     If(
     !IsEmpty(Errors('DataSource')),
     Office365Outlook.SendEmailV2(
     "EmailId",
     "Error has Occured",
     Concat(Errors('DataSource'), Column&": "&Message),
     {Importance: "High"}
     ),
     Navigate('OtherScreen');
     )

     

    Note: Make sure to add Office365Outlook as Data source

  • SabineR Profile Picture
    23 on at

    Hi @StalinPonnusamy , thank you for your 2 messages. 

    As the 2 solutions, IfError() and Errors(), exist, is Errors() the more appropriate for Error handlings from Sharepoint?

     

    Kind regards,

    Sabine

     

     

     

     

     

  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @SabineR 

     

    Possible to get multiple errors. So we concatenate the errors and display them. This should work for a single error as well. So better to handle multiple whenever possible.

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

#2
11manish Profile Picture

11manish 193

#3
Valantis Profile Picture

Valantis 138

Last 30 days Overall leaderboard