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 / Office365Outlook.sendm...
Power Apps
Answered

Office365Outlook.sendmailV2 failed problem

(0) ShareShare
ReportReport
Posted on by 312

I am sending an email with a pdf attachment which has worked fine until today. 

 

Today I started getting the following error message:

 

"Office365Outlook.sendEmailV2 failed: The data returned in the response is invalid. Response data should be a valid JSON object."

 

The email still works as it should.

 

Any ideas why this error message is being displayed?

 

This is the code I'm using.

 

UpdateContext({varPDFBlob: PDF(contPDFText_1,{ExpandContainers: true})});
If(
 SendAssessmentEmail,
 
 Office365Outlook.SendEmailV2(
 If(
 cboxBlockEmail_1.Checked,
 varUserSettings.UserEmail,
 Not(cboxBlockEmail_1.Checked),
 varUserSettings.UserEmail & ";" & "another@email.com"),
 $"text text text {frmAssessment_1.LastSubmit.NameOfPersonBeingAssessed}",
 $"text text text",
 {Attachments: Table({Name: "Name of attachment " & frmAssessment_1.LastSubmit.NameOfPersonBeingAssessed & ".pdf", ContentBytes: varPDFBlob})}
 )
 );

 

 

Categories:
I have the same question (0)
  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Do you have the ParseJSON/Untyped feature setting enabled for your App?

  • ramzez Profile Picture
    312 on at

    Yes it is on. The email is sent and the pdf is attached and the error message is shown only after running the code.

  • Verified answer
    iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Ok, the reason I ask is that the feature is still experimental, and as such shouldn't be used in any production/live apps (as it could break, change, or be removed at any time) - its likely that its treating the returned object as an incorrect type (UntypedObject) as I don't think its compatible with all function calls.

     

    Have you tried casting it explicitly to JSON using the JSON() function? its kind of part of the issue with the ParseJSON/UntypedObject feature where you have to cast it explicitly - there's a feedback link here:

    https://powerusers.microsoft.com/t5/Power-Apps-Experimental-Features/ParseJSON-feedback/m-p/1877977 

     

    Your second option would be to try turning off that feature and seeing if that resolves your issue?

  • ramzez Profile Picture
    312 on at

    Turning off the ParseJSON/Untyped feature setting does resolve the issue. 

     

    However I would like to experiment with the ParseJSON at the same time so what would be the correct way of using the JSON function in this case?

  • ramzez Profile Picture
    312 on at

    Upon further testing I'm getting the same error message with just the following basic code and ParseJSON/Untyped feature setting turned on:

    Office365Outlook.SendEmailV2(
     varUserSettings.UserEmail,
     "title text",
     "body text"
    )

    I'll post this on the Experimental section as it seems to be only related to the ParseJSON/Untyped feature.

    Thank you for your help.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I just started having the same issue yesterday. The only thing causing it in the app I'm working on is the Parse JSON experimental setting being turned on. hmmm

  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Please make sure to give your feedback at the thread for the experimental feature so that they know its affecting people 🙂

    https://powerusers.microsoft.com/t5/Power-Apps-Experimental-Features/ParseJSON-feedback/m-p/1877977 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Done, 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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard