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 Apps
Answered

Email error

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hai I have a Screen where Patching the records to the Datasource is works fine.

In addition i have added a email and Notify message in the Patch function. I got an email and the notify message when hits save button but the problem is It always shows only the Successful message to email and notification even when the record is not patched to the DataSource.

 

Here is my Function: Please help

OnSelect: Button

now3.png

 

 

 

Categories:
  • mdevaney Profile Picture
    29,993 Moderator on at

    @Anonymous 

    The variable varReturnedRecord is not actually a record variable.  Its a table: I know this because you are using FORALL to create several patches.  When more than one record is stored in a variable it will be a table.

     

    Instead of using the ISBLANK function which works for records...

    If(!IsBlank(

     

    Try using the ISEMPTY function which works for tables...

    If(!IsEmpty(

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hai i have tried as you said, But still the same problem persist

    Please  help me to get rid from that.

      I have an email and notification if the patch saved means "SAVED SUCCESSFULL"

      but if the patching record  is not saved to the datasource also have the  "SAVED SUCCESSFULL" Mail and notification .

     

    mail.png

     

     And also i changed my function like this but still getting the same error

    Notify2.png

     

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Regarding the issue that you mentioned, I think the Errors function could achieve your needs. If the Patch formula is not executed as expected, the following formula would include the error message:

    Errors(mmmm)

     

    On your side, you could detect if the Errors(mmmm) formula result is Empty or not, if it is empty, it means that your Patch function works well, otherwise, it means there is something wrong with your Patch function.

     

    On your side, please consider modify your formula as below:

    Set(
     varReturnedRecord, 
     ForAll(
     Gallery1_13.AllItems,
     Patch(
     mmmmm, 
     Defaults(mmmm),
     ...
     )
     )
    );
    If(
     !IsEmpty(Errors(mmmm)), // Modify formula here
     Microsoft365Outlook.SendEmailV2(...);Notify("Error: Your update to file ..."),
     Microsoft365Outlook.SendEmailV2(...);Notify("Your updates to file ....")
    )

     

    For your mentioned formula, the varReturnedRecord variable would store a Table value rather than a Record value, so you should use IsEmpty function to detect if the varReturnedRecord is empty instead of IsBlank() function. 

    In addition, what do you mean about the "record is not patched to the DataSource"? Do you mean that the Patch function throws error? Regarding the formula that you mentioned, the varReturnedRecord variable would always contain records, even though, one of the records has not be patched to your data source. So you could not use the varReturnedRecord variable as check condition.

     

    Regards,

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard