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 Automate / How can I get the emai...
Power Automate
Unanswered

How can I get the email status report after sending email via Send an Email V2

(0) ShareShare
ReportReport
Posted on by 12

Hi All!!

 

I have used Power Automate to help me send out a bunch of emails, and instead of going back to the flow and check the status 1 by 1, is there any way that I can get a status report OR export the email content that I send out using the flow to a file?

 

Million thanks in advance

Categories:
I have the same question (0)
  • dahlgebra Profile Picture
    119 on at

    Hi,

     

    An easy way to solve the problem is to make a SharePoint list with columns that you need: Body, subject, etc...

     

    When you are sending emails, I assume that the "send email- action" is inside a loop. If you just add a second action inside the loop that writes to the SharePoint list, you will get every email you sent logged. 

     

    Good luck!

  • Verified answer
    Sundeep_Malik Profile Picture
    6,484 on at

    Hey @ELFish_Nam 

    Not sure you were looking for this or not.

    But you can save an actions details in a SP List like the action name, start time, end time, final result, inputs and outputs.

     

    You can do this with result function. You will have to add the action in a scope. After that use a compose to store the result of the above scope. with: result('Scope'). Then use parse json, and after that just save everything in your database or if you want the email content then just save the body of the email.

     

    Sundeep_Malik_1-1663830716461.png

     

     

    Sundeep_Malik_0-1663830686157.png

     

  • ELFish_Nam Profile Picture
    12 on at

    Hi @Sundeep_Malik ,

     

    I have tried, not it seems not so work, the flow failed in the parse json action. 

     

    ELFish_Nam_0-1664447359645.png

     

  • Sundeep_Malik Profile Picture
    6,484 on at

    @ELFish_Nam 

    That's strange, never happened with me. I hope you copied everything you got from that compose to that parse JSON.

    Can you show it in edit mode and exact error you are getting.

  • ELFish_Nam Profile Picture
    12 on at

    @Sundeep_Malik 

     

    please find the below:

     

    ELFish_Nam_0-1664447660055.png

    ELFish_Nam_1-1664447698463.png

     

  • Sundeep_Malik Profile Picture
    6,484 on at

    @ELFish_Nam 

    I have used this 100 times never got an error. I hope you copied the output you are getting above compose to the schema of parse JSON.

    Can you paste the schema here as well?

    Just the schema nothing else.

  • ELFish_Nam Profile Picture
    12 on at

    Hi @Sundeep_Malik ,

     

    Sorry for the late reply hahah

     

    Here you go for the schema and the error message

     

    {
     "type": "object",
     "properties": {
     "name": {
     "type": "string"
     },
     "inputs": {
     "type": "object",
     "properties": {
     "host": {
     "type": "object",
     "properties": {
     "apiId": {
     "type": "string"
     },
     "connectionReferenceName": {
     "type": "string"
     },
     "operationId": {
     "type": "string"
     }
     }
     },
     "parameters": {
     "type": "object",
     "properties": {
     "emailMessage/To": {
     "type": "string"
     },
     "emailMessage/Subject": {
     "type": "string"
     },
     "emailMessage/Body": {
     "type": "string"
     },
     "emailMessage/Cc": {
     "type": "string"
     },
     "emailMessage/ReplyTo": {
     "type": "string"
     },
     "emailMessage/Importance": {
     "type": "string"
     }
     }
     }
     }
     },
     "outputs": {
     "type": "object",
     "properties": {
     "statusCode": {
     "type": "integer"
     },
     "headers": {
     "type": "object",
     "properties": {
     "Pragma": {
     "type": "string"
     },
     "Cache-Control": {
     "type": "string"
     },
     "Set-Cookie": {
     "type": "string"
     },
     "x-ms-request-id": {
     "type": "string"
     },
     "Strict-Transport-Security": {
     "type": "string"
     },
     "X-Content-Type-Options": {
     "type": "string"
     },
     "X-Frame-Options": {
     "type": "string"
     },
     "Timing-Allow-Origin": {
     "type": "string"
     },
     "x-ms-apihub-cached-response": {
     "type": "string"
     },
     "x-ms-apihub-obo": {
     "type": "string"
     },
     "Date": {
     "type": "string"
     },
     "Content-Length": {
     "type": "string"
     },
     "Expires": {
     "type": "string"
     }
     }
     }
     }
     },
     "startTime": {
     "type": "string"
     },
     "endTime": {
     "type": "string"
     },
     "trackingId": {
     "type": "string"
     },
     "clientTrackingId": {
     "type": "string"
     },
     "clientKeywords": {
     "type": "array",
     "items": {
     "type": "string"
     }
     },
     "code": {
     "type": "string"
     },
     "status": {
     "type": "string"
     }
     }
    }

     

    error message:

     

    [
     {
     "message": "Invalid type. Expected Object but got Array.",
     "lineNumber": 0,
     "linePosition": 0,
     "path": "",
     "schemaId": "#",
     "errorType": "type",
     "childErrors": []
     }
    ]
  • Sundeep_Malik Profile Picture
    6,484 on at

    @ELFish_Nam 

    try this json:

     

    {
        "type""array",
        "items": {
            "type""object",
            "properties": {
                "name": {
                    "type""string"
                },
                "inputs": {
                    "type""object",
                    "properties": {
                        "host": {
                            "type""object",
                            "properties": {
                                "apiId": {
                                    "type""string"
                                },
                                "connectionReferenceName": {
                                    "type""string"
                                },
                                "operationId": {
                                    "type""string"
                                }
                            }
                        },
                        "parameters": {
                            "type""object",
                            "properties": {
                                "emailMessage/To": {
                                    "type""string"
                                },
                                "emailMessage/Subject": {
                                    "type""string"
                                },
                                "emailMessage/Body": {
                                    "type""string"
                                },
                                "emailMessage/Importance": {
                                    "type""string"
                                }
                            }
                        }
                    }
                },
                "outputs": {
                    "type""object",
                    "properties": {
                        "statusCode": {
                            "type""integer"
                        },
                        "headers": {
                            "type""object",
                            "properties": {
                                "Pragma": {
                                    "type""string"
                                },
                                "x-ms-request-id": {
                                    "type""string"
                                },
                                "Strict-Transport-Security": {
                                    "type""string"
                                },
                                "X-Content-Type-Options": {
                                    "type""string"
                                },
                                "X-Frame-Options": {
                                    "type""string"
                                },
                                "Cache-Control": {
                                    "type""string"
                                },
                                "Set-Cookie": {
                                    "type""string"
                                },
                                "Timing-Allow-Origin": {
                                    "type""string"
                                },
                                "x-ms-apihub-cached-response": {
                                    "type""string"
                                },
                                "x-ms-apihub-obo": {
                                    "type""string"
                                },
                                "Date": {
                                    "type""string"
                                },
                                "Content-Length": {
                                    "type""string"
                                },
                                "Expires": {
                                    "type""string"
                                }
                            }
                        }
                    }
                },
                "startTime": {
                    "type""string"
                },
                "endTime": {
                    "type""string"
                },
                "trackingId": {
                    "type""string"
                },
                "clientTrackingId": {
                    "type""string"
                },
                "clientKeywords": {
                    "type""array",
                    "items": {
                        "type""string"
                    }
                },
                "code": {
                    "type""string"
                },
                "status": {
                    "type""string"
                }
            },
            "required": [
                "name",
                "inputs",
                "outputs",
                "startTime",
                "endTime",
                "trackingId",
                "clientTrackingId",
                "clientKeywords",
                "code",
                "status"
            ]
        }
    }
  • ELFish_Nam Profile Picture
    12 on at

    OMG that's cool! it is fixed! thank you so much! @Sundeep_Malik 

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 Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard