Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 4E10csykGdkSZUjITqBCrm
Power Automate - Building Flows
Answered

Connecting Outlook Flagged Emails to Planner Tasks

Like (1) ShareShare
ReportReport
Posted on 17 Oct 2019 19:33:40 by 203

I am looking to link flagged emails in Outlook 365 to Planner tasks.  The sample Flow "Create planner tasks for flagged emails in Office 365" creates a Planner task from a flagged Outlook email, however upon completing the Planner task, the associated Outlook task remains open.  Therefore, I am attempting to extend this flow to capture the Outlook messageId within the Planner task, and then create a second Flow that triggers upon completion of the Planner task, completing the associated Outlook task.  

 

My initial flow:

Flow1-PlannerTaskWithOutlookReference.png

 

Can someone help me with the code to extract the string after "OutlookMessageId="so that the second Flow will be able to use it to find the associated Outlook task?

 

Thanks,

Jim

  • KP10 Profile Picture
    14 on 11 Oct 2023 at 15:40:35
    Re: Connecting Outlook Flagged Emails to Planner Tasks

    Hi,

     

    I've been following your flow process and included a section in the 'create' task flow to send attachments to planner as well. The first flow works perfectly, and I get everything in a planner task that I need when flagging an email.

     

    I'm having issues with the second flow, marking the email flag as complete when the task is completed. I'm getting the below:

    KP10_0-1697038771389.png

    KP10_1-1697038783852.png

    Any ideas what might be causing the issue?

     

    Thanks, Kat

  • JimSutt Profile Picture
    203 on 28 Apr 2022 at 17:19:47
    Re: Connecting Outlook Flagged Emails to Planner Tasks

    @Anonymous , I actually get two as well, which was not the case when I originally created this flow.  I honestly do not know why it is happening as that would mean that the flow is triggering twice.  I actually stopped using this flow after Microsoft released the To Do app, which allows me to see my Outlook tasks and Planner tasks in the same application.  Maybe check the Planner task for the Message ID before creating a new task?

  • Community Power Platform Member Profile Picture
    on 28 Apr 2022 at 17:01:20
    Re: Connecting Outlook Flagged Emails to Planner Tasks

    Actually just realised it happens even if I don’t move the task to another bucket - I just get two.

    Im using the new v4 version of the Outlook flagging an email trigger which is the only difference I think.

  • Community Power Platform Member Profile Picture
    on 28 Apr 2022 at 15:41:33
    Re: Connecting Outlook Flagged Emails to Planner Tasks

    @JimSutt - I copied your two flows and all seemed great at first.

    I later noticed that when I moved a task from the original 'To Do' bucket then the task would be created a second time back in the original 'To Do' bucket - any ideas?

  • JimSutt Profile Picture
    203 on 21 May 2021 at 18:24:49
    Re: Connecting Outlook Flagged Emails to Planner Tasks

    Glad to help @QuentinLucchini !  

  • QuentinLucchini Profile Picture
    4 on 21 May 2021 at 18:03:04
    Re: Connecting Outlook Flagged Emails to Planner Tasks

    Wow thanks for the rapid answer, I would have done better to ask you before I spend one hour on it !

     

    It was that, a simple space ! 

     

    Thank you !

  • JimSutt Profile Picture
    203 on 21 May 2021 at 16:22:14
    Re: Connecting Outlook Flagged Emails to Planner Tasks

    Hi @QuentinLucchini , the Split function is looking for an exact match of the string to use to split the content.  In your error message, the Split command says it is looking for 'OutlookMessageId ='. Therefore, check your test Planner task and make sure that you are using that exact string.  It is case sensitive, meaning the O and M and I are capitalized and there is a space before the = sign.  Looking for that exact matching delimiter is the first step in troubleshooting your error.  

  • QuentinLucchini Profile Picture
    4 on 21 May 2021 at 16:04:09
    Re: Connecting Outlook Flagged Emails to Planner Tasks

    Hi @JimSutt ! I read your solution and I love the idea behind this, unfortunately I get an error when running the second flow, I'm not an expert on variables so I'm not sure how to interpret this. Seems that the function "Split" need to return an array that contains substrings but can't find the [1], don't know why. I use Power Automate in French, that's why "Get_task_details" is in french, I translate the error message in english :

     

    "Unable to process template language expressions in action entries "Message" at row "1" and column "28063": "Unable to write template language expression" split (body (' Obtenir_les_détails_de_la_tâche')? ['Description'], 'OutlookMessageId =') [1] ", because array index" 1 "is outside the range (0, 0) of the array. For usage details, see https://aka.ms/logicexpressions. "."

     

    If you have any ideas, would be great 🙂

  • rdb Profile Picture
    6 on 30 Apr 2021 at 20:56:40
    Re: Connecting Outlook Flagged Emails to Planner Tasks

    Thanks @JimSutt - that was it!  Everything now works.  Much appreciated sir.

  • JimSutt Profile Picture
    203 on 30 Apr 2021 at 19:07:46
    Re: Connecting Outlook Flagged Emails to Planner Tasks

    Hi @rdb ,

    It looks like your issue with with capitalization.  In your screenshot of your Planner task, you have "OutlookMessageID=" but in your compose statement, you indicated the code is parsing on "OutlookMessageId=".  

     


    Flow #1.PNG

     

    Here's the compose expression: split(body('Get_task_details')?['description'],'OutlookMessageId=')[1]

     


    I'm fairly certain that the case of the delimiter is taken into consideration.  Try updating the Compose step to look for 'OutlookMessageID=' (which then matches the text case in your Planner task) and see if that fixes it.  

    When testing the flow, look at the flow history, and click on the latest run.  You can then expand the Compose statement and check on the Output to confirm the Outlook message ID matches the one in your Planner task.  

     

    Hope that helps!!

     

    Regards,

    Jim

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,751 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard