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:
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
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:
Any ideas what might be causing the issue?
Thanks, Kat
@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?
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.
@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?
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 !
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.
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 🙂
Thanks @JimSutt - that was it! Everything now works. Much appreciated sir.
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=".
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
WarrenBelz
146,751
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,091
Most Valuable Professional