cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
js4
Level: Powered On

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

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

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

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

For the subject, use dynamic data:Capture-240.png

For "Also, how to copy the sent email text into the field "Description"?"

I can't see an option for that. I looked in "Update Task" also and can't see that as an option natively.

 

regards addDays question. by all means leave it blank ... it was just me demonstrating how you could set it that way if required.

 

 

Glad you have it all working - Happy Flowing @js4 !

 

If you have found my posts helpful, please mark them thumbs up.

If a post has solved your problem, please click "Accept as Solution".

Any other questions, just ask.

Thanks, Alan


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


14 REPLIES 14
Super User
Super User

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

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/cr...

 

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


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


js4
Level: Powered On

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

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

Super User
Super User

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

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


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


js4
Level: Powered On

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

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

Super User
Super User

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

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


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


js4
Level: Powered On

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

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?

Super User
Super User

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

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


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


js4
Level: Powered On

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

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.

 

 

Super User
Super User

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

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

 


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


js4
Level: Powered On

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

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.
js4
Level: Powered On

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

Update: it works now. The task is created and  I can open it at Planner.

 

Please, is there any way to name the Task with the same title as the Email Subject?

Also, how to copy the sent email text into the field "Description"?

 

And advice is welcome :-)

Super User
Super User

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

For the subject, use dynamic data:Capture-240.png

For "Also, how to copy the sent email text into the field "Description"?"

I can't see an option for that. I looked in "Update Task" also and can't see that as an option natively.

 

regards addDays question. by all means leave it blank ... it was just me demonstrating how you could set it that way if required.

 

 

Glad you have it all working - Happy Flowing @js4 !

 

If you have found my posts helpful, please mark them thumbs up.

If a post has solved your problem, please click "Accept as Solution".

Any other questions, just ask.

Thanks, Alan


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


js4
Level: Powered On

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

Alan, thank you! :-)

Super User
Super User

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

You're most welcome @js4 .

Glad to be of assistance!

 

Thanks, Alan


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Users Online
Currently online: 192 members 4,256 guests
Please welcome our newest community members: