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 / "When a new email is S...
Power Automate
Unanswered

"When a new email is Sent" - Planner vs Outlook

(0) ShareShare
ReportReport
Posted on by 36

Hello,

 

I am new to Planner and Flow.  I could not find how to setup automatically a Planner Task when I SEND an email flagged as important from my Outlook. Any advice is welcome. 🙂

 

rgs

 

 

Categories:
I have the same question (0)
  • AlanPs1 Profile Picture
    2,471 on at

    Hi @js4 

    If I am picking you up correctly, does this meet your needs?

    https://emea.flow.microsoft.com/en-us/galleries/public/templates/49b235a0374011e7870df906aa521b7a/create-planner-tasks-for-important-office-365-emails/

     

    capture-268.png

    If you find my posts helpful, please mark with thumbs up

    If this solves your issue, please click "Accept as Solution"

    Any questions, just ask.

    Thanks, Alan

  • js4 Profile Picture
    36 on at

    Hello Alan,

     

    thank you. However, the link point to a trigger for emails "received in the inbox", while I am looking for emails I sent from Outlook and are marked "High Importance". Those emails I sent should create a new Task in Planner. I tried the trigger below (click on link) but it is not working. I sent an email marked "High Importance" and it will not create a Task inside the Plan "Incoming Tasks to Distribute". Any advice is welcome 🙂

     

    https://www.diigo.com/item/image/5pj5q/qsay

  • AlanPs1 Profile Picture
    2,471 on at

    Hi @js4 , thank you for the clarification as I did pick you up wrongly ... Monday!

    So, targeting Sent items worked for me ... please see below:capture-269.png

    created:capture-270.png

    If you find my posts helpful, please mark with thumbs up

    If this solves your issue, please click "Accept as Solution"

    Any questions, just ask.

    Thanks, Alan

  • js4 Profile Picture
    36 on at

    Hi Alan,

     

    I did exactly as you did, but it will not work. I tried sending an email from Outlook webapp and Outlook client. Please, any ideas how to solve this issue? 🙂

     

    Edit your flow Microsoft Flow.png

  • AlanPs1 Profile Picture
    2,471 on at

    Hi @js4 

    Are there any errors, did your Flow run as a success or fail? can you please post some data on the reults as it 100% worked for me.

     

    Thanks, Alan

  • js4 Profile Picture
    36 on at

    On checking the Flow Checker there are no errors indicated in it. Is there any other way to do a check on the triggers and register it so I can share it with you?

  • AlanPs1 Profile Picture
    2,471 on at

    If you go to the Flow can you see any green ticks like I demo below?capture-272.png

    Or are there fails, or nothing?

    If you have data, please click in and take as many screen grabs as you can like the below:capture-273.png

    This is the only way we will be able to see if this is working or not really. as you will see above mines has in the way I have detailed.

     

    Thanks, Alan

  • js4 Profile Picture
    36 on at

    Thank you. Here you have them:

     

    1. The Flow has the green ticks. See https://www.diigo.com/item/image/5pj5q/rxve

    2. But there is no run history registered.

     

    The code:

    1. When an Email arrives:

    {
     "inputs": {
     "host": {
     "connection": {
     "name": "@parameters('$connections')['shared_office365']['connectionId']"
     }
     },
     "method": "get",
     "path": "/Mail/OnNewEmail",
     "queries": {
     "folderPath": "Id::AQMkADAzY2MBZjFmLTNjMzgtNGVkZi1iODdhLThmOTRkZAA5MmM0NzAALgAAA66h-FR5-BBKk0XDSR3CGNUBAIP9dWobQNdAh0avekbeD7UAAAIBCQAAAA==",
     "from": "sender@email.com;",
     "importance": "High",
     "fetchOnlyWithAttachment": false,
     "includeAttachments": false
     },
     "authentication": "@parameters('$authentication')"
     },
     "recurrence": {
     "interval": 5,
     "frequency": "Minute"
     },
     "metadata": {
     "Id::AQMkADAzY2MBZjFmLTNjMzgtNGVkZi1iODdhLThmOTRkZAA5MmM0NzAALgAAA66h-FR5-BBKk0XDSR3CGNUBAIP9dWobQNdAh0avekbeD7UAAAIBCQAAAA==": "Sent Items",
     "flowSystemMetadata": {
     "swaggerOperationId": "OnNewEmail"
     }
     },
     "splitOn": "@triggerBody()?['value']"
    }

    2. Create a Task

    {
     "inputs": {
     "host": {
     "connection": {
     "name": "@parameters('$connections')['shared_planner']['connectionId']"
     }
     },
     "method": "post",
     "body": {
     "planId": "PyRrlTJNm0W67o-DeXqxmCpcAEjGq",
     "title": "New Task to Distribute",
     "bucketId": "Nmd8dwjsWUxOPfJ1i6-FIDpcABOA6",
     "startDateTime": "@{utcNow()}",
     "dueDateTime": "@{addDays(5)}"
     },
     "headers": {
     "prefer": " return=representation"
     },
     "path": "/v1.0/planner/tasks",
     "authentication": "@parameters('$authentication')"
     },
     "metadata": {
     "flowSystemMetadata": {
     "swaggerOperationId": "CreateTask_V2"
     }
     }
    }

    rgs

     

    J.

     

     

  • AlanPs1 Profile Picture
    2,471 on at

    Hi @js4, so based on your image the flow hasn't triggered.Untitled-1.png

     

    Try taking out the From email (if used that should be your own email, the sender of the email that will generate the task). You have "from": "sender@email.com;". This may just be a placeholder but this email would need to match the email of the person sending the mail that will generate the planner task.

    Also, can you confirm tha the email you sent was set to high priority to match the Flow's requirements?

    "importance": "High" from your peek code below.

     

    Thanks, Alan

     

  • js4 Profile Picture
    36 on at

    Hi Alan,

     

    thank you. I found out the error, my mistake: "

    InvalidTemplate. Unable to process template language expressions in action 'Create_a_task' inputs at line '1' and column '2523':
    'The template language function 'addDays' expects a timestamp as the first parameter, the number of days to add as the second parameter, and an optional format string as the third parameter. The function was invoked with '1' parameter(s). Please see https://aka.ms/logicexpressions#adddays for usage details.'."
     
    How should I setup the number of days in addDays? Or may I leave this field blank, because I want this trigger to work in the next years?
     
    Rgs
     
    J.

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard