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 / Patch Fails with Offic...
Power Apps
Unanswered

Patch Fails with Office365Outlook

(0) ShareShare
ReportReport
Posted on by 42

Hi,

 

I am trying to send email using 'Office365Outlook.ReplyToV3' I have passed in:

 

  • Message ID
  • To
  • Subject
  • Body
  • Mailbox Address

My looks like below:

 

Office365Outlook.ReplyToV3(Last(Filter(MessagesTable,Ticket.'Messages ID'=CurrentMessage.'Messages ID')).'Message ID',
{To:MainTable.'Raised By'.'Primary Email',
 Subject:Last(Filter(MessagesTable,Ticket.'Ticket ID'=CurrentMessage.'Ticket ID')).Subject,
 Body:TextInputCanvas2.Value,
 mailboxAddress:CurrentUser.'Primary Email'});

 

When I use this, sends the email no problem, however when I then go to patch the sent message to a Dataverse table I then get the error...

 

Rob1990_0-1714260456340.png

 

When I go into Dataverse table this record and all the fields have been filled out correctly however when I go into the button there is error lines over the 'Office365Outlook.ReplyToV3'. 

 

The email does not get sent, but the data appears inside Dataverse, also in the code the patch is after sending the email.

 

Can anyone shed some light on why this code would work on it's own but doesn't when adding the patch function after inside the on select inside a button

 

Thanks

 

Categories:
  • TuongDoan Profile Picture
    573 Moderator on at

    I believe this filter function returned blank result.  

     

    Last(Filter(MessagesTable,Ticket.'Messages ID'=CurrentMessage.'Messages ID')).'Message ID'

     

    You have to add more condition to make sure it's not blank before passing the parameter to the function

     

    --------------------------

    If the solution I provided assisted you in resolving this issue, kindly select "Accept as solution" This will help others in finding the solution more expediently 😄Also, a Thumbs up would be a great compliment!

  • Rob1990 Profile Picture
    42 on at

    Hi @TuongDoan,

     

    That's what I thought so I did but the code into a text label to see the value and it did return the message ID Value...

     

    Rob1990_0-1714312893368.png

     

    Last(Filter(MessagesTable,Ticket.'Messages ID'=CurrentMessage.'Messages ID')).'Message ID'


    It's strange that this only fails when adding the patch function afterwards, If I remove the patch to Dataverse it works and sends the email.

     

    I also tried this with 'Coalesce' but this didn't work either...

     

    Coalesce(Last(Filter(MessagesTable,Ticket.'Messages ID'=CurrentMessage.'Messages ID')).'Message ID')

     

    Thanks

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 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 320

#3
Mohsin Ali Profile Picture

Mohsin Ali 246

Last 30 days Overall leaderboard