cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Naz
Advocate I
Advocate I

Delete Email (V2) - Whats the email ID?

Im trying to use the Delete Email (V2) to delete emails that were sent out through my flow (from the Sent Items folder in Outlook). However, I cant figure out what the email ID is. 

 

If I use "body('Send_an_email_(V2)['Message_ID'] or "body('Send_an_email_(V2)['ID'], the flow throws an error. 

 

Any help here?

1 ACCEPTED SOLUTION

Accepted Solutions
edgonzales
Super User II
Super User II

@Naz 

Hey there.  The eMail ID is a unique identifier of the message.  If you're using the same flow that is sending the message, the only dynamic value would be the "Body" from the Send eMail step.

 

One approach might be to send the email, then do a "Get eMails" step from the Sent Items folder, then further filter based on the subject (maybe even the To:), and then that step should give you a message ID to use in the Delete step.

 

Here's a thread where someone did something similar.

 

Keep us posted.

-Ed-

 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

View solution in original post

1 REPLY 1
edgonzales
Super User II
Super User II

@Naz 

Hey there.  The eMail ID is a unique identifier of the message.  If you're using the same flow that is sending the message, the only dynamic value would be the "Body" from the Send eMail step.

 

One approach might be to send the email, then do a "Get eMails" step from the Sent Items folder, then further filter based on the subject (maybe even the To:), and then that step should give you a message ID to use in the Delete step.

 

Here's a thread where someone did something similar.

 

Keep us posted.

-Ed-

 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

View solution in original post

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Users online (77,311)