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

Notifications

Announcements

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard