Skip to main content
Community site session details

Community site session details

Session Id : yyYTsqt6mezgf/MxSLHBwM
Power Automate - Using Flows
Unanswered

Creating a Task from an Email - Approved Users, Using Email Body for Bucket etc and Using an Alias for assigned to

Like (0) ShareShare
ReportReport
Posted on 20 Feb 2024 15:48:59 by 8

Hi

 

I've now managed to get my flow up and running, to automatically create a task when an email is received to a shared inbox. At present, this creates the task with the title being the Subject of the email, and can only assign to the same people each time and place it in the same bucket, but I would like to take this a bit further.

 

I would like to be able to do 3 things additional to this:

1) Reject Emails that have not been received from an approved list of users (which can be hardcoded somewhere if needed), and tell the sender to use another email address. Can this be done with branching? I'm not sure how to enter a statement of 'if email is NOT from these people, reject'.

 

2) Create the task based on values submitted within the body of the email - I'd like to set up a Quick Action template in Outlook to send the information in the same way every time, and then have the Flow read this information to decide what the parameter should be.

For example:

Title: Subject of Email

Notes: Place in Body of task

Bucket: Which bucket task is for

Assign To: Neil (name, rather than full email address)

Due Date: DD/MM/YY (or a default value if left blank)

 

3) Finally, I would like to be able to read my 'Assign To:' parameter above using the users first name (eg: Neil, Joe, Rachel), and to then assign the task to that particular person.

 

I've added some pictures of my flow setup so far for reference - I appreciate I'm probably stretching the limits of Outlook for this sort of task, but it's what I have available and integrated at the moment!

 

Any suggestions would be very much appreciated 🙂

  • Nived_Nambiar Profile Picture
    17,972 Super User 2025 Season 2 on 21 Feb 2024 at 17:15:58
    Re: Creating a Task from an Email - Approved Users, Using Email Body for Bucket etc and Using an Alias for assigned to

    Hi @NeilK2 

     

     

    since your main concern on how to extract the values from email body using Power Automate, Let me share how you can extract details from email body 

     

    I will show a demo on how to extarct few of values, based on same logic, you can extend the field value extraction.

     

    Assume the mail body has data like this :

    Nived_Nambiar_0-1708535267883.png

     

     

    Now let's create a simple Power Automate flow which runs when new email arrives.

     

    Nived_Nambiar_1-1708535304292.png

     

    1. after the trigger when email arrived is used - use action HTML to text to convert the html content of email body to simple text format like below

    Nived_Nambiar_2-1708535374226.png

     

     

    2. So for example- let's extract Title field from email body which has value of Task Title 1. To extract it refer the below logic

    use filter array like below

    Nived_Nambiar_3-1708535456798.png

     

    in From field- use split function- use split function to split the output of HTML to text action using new line using below expression-  split(outputs('Html_to_text')?['body'],decodeUriComponent('%0A'))

     

    in the left side use expression trim(item()) and in the right side - use value Title:

     

    So overall, the filter array is filtering the array (generated as due to splitting of email body by new line & then checking whether any line starts with Title:.

     

    Next use compose action to extract Title value corresponding to field value

    Nived_Nambiar_4-1708535648575.png

     

    Expression: -  split(body('Filter_array')?[0],':')?[1]

     

    This will take the array element from filter array and again split by colon (:) and takes second element out of it which would be title value.

     

    see below flow run results

    Nived_Nambiar_5-1708535749192.png

     

     

    Hope it helps !

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

  • NeilK2 Profile Picture
    8 on 20 Feb 2024 at 17:26:04
    Re: Creating a Task from an Email - Approved Users, Using Email Body for Bucket etc and Using an Alias for assigned to

    Exactly right 🙂 I can submit the details with the same email template every time so it's a constant place to read from, but I just don't know how to get Power Automate/Flow to read those details from the body and then use them to create the task

     

    Thank you for any help you can give - it's really appreciated!

  • Nived_Nambiar Profile Picture
    17,972 Super User 2025 Season 2 on 20 Feb 2024 at 17:22:07
    Re: Creating a Task from an Email - Approved Users, Using Email Body for Bucket etc and Using an Alias for assigned to

    Hi @NeilK2 

     

    Ok i hope i have got it now. So email body itself has all details of task to be created, flow has to capture all the required details and then should use those to create/update tasks , am i right ?

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

  • NeilK2 Profile Picture
    8 on 20 Feb 2024 at 16:53:15
    Re: Creating a Task from an Email - Approved Users, Using Email Body for Bucket etc and Using an Alias for assigned to

    Hi

    On the second question, I'd like to be able to add text in the body of the email to decide which bucket the task should be allocated to for example, as well as assigned user - but this means the flow needs to be able to interpret the text and then allocate accordingly. I guess I want the assigned user, bucket and other parameters to be dynamic, based on a text input in the email body.

     

    I found something similar here, but this is only make the task title equal to the body (and doesn't differentiate between different parameters like bucket, user assigned to etc). It also doesn't seem to have worked for the user!

     

    https://powerusers.microsoft.com/t5/Building-Flows/Extract-specific-text-from-email-body-to-create-planner-task/td-p/678943

  • Nived_Nambiar Profile Picture
    17,972 Super User 2025 Season 2 on 20 Feb 2024 at 16:46:09
    Re: Creating a Task from an Email - Approved Users, Using Email Body for Bucket etc and Using an Alias for assigned to

    Hi @NeilK2 

     

    doubt regarding the second question ? - does the flow is used to update the task which is created using an incoming email ?

     

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Featured topics

Restore a deleted flow
Loading complete