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 / Assign planner task to...
Power Automate
Answered

Assign planner task to all email recipients if they are members of that group

(0) ShareShare
ReportReport
Posted on by 5

Hello,


I have a flow which creates a planner task when an email is flagged. But it fails if there are more than one recepient and/or if the recepeint is not part of the group. I found this topic Creating a planner task from a flagged outlook email which helps filter out email addresses not in our organisation, but won't help with emails addresses that are ours.


Is there a way to solve this?

Categories:
I have the same question (0)
  • Verified answer
    Expiscornovus Profile Picture
    33,194 Most Valuable Professional on at

    Hi @MongDev,

     

    I would say this is possible. You could use a list group members action and compare that with the toRecipients field of your flagged email.

     

    In my example below I am converting both to arrays and use an intersection function to compare the two. The result is converted back into a semi-colon separated string, because this is required for the assigned to field of a planner task.

     

    1. Add an Initialize variable action and use a split expression to create an array for the toRecipients field from your flagged email.

     

    split(triggerOutputs()?['body/toRecipients'], ';')

     

    splittorecipients.png

    2. Add another Initialize variable of type Array, call it for instance PlannedUserEmails, leave the value empty

    planneduseremails.png

    3. Add a List Group Members, select the group of your Planner Plan

    listgroupmembers.png

    4. Add an Append to array variable action. Set the value to Mail for the PlannedUserEmails variable. This is a dynamic value from the previous List Group members action

    appendmailtovariable.png

     

    5. Add an Compose, use the following expression to compare the two array variables with an intersection

     

    intersection(variables('FlaggedEmailUsers'), variables('PlannerUsersEmails'))

     

    compose_intersection.png

    6. Add a Create the task action. Use the output of the compose for the Assigned users, by using the following expression 

     

    join(outputs('Compose_-_Intersection'), ';')

     

     createatask_multiuserassigned.png

     

    Hope this helps a bit?

  • MongDev Profile Picture
    5 on at

    @ExpiscornovusThank you! Works like a charm.

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

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard