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 🙂
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 :
Now let's create a simple Power Automate flow which runs when new email arrives.
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
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
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
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
Hope it helps !
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! 🙌
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!
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 ?
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! 🙌
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!
Hi @NeilK2
doubt regarding the second question ? - does the flow is used to update the task which is created using an incoming email ?
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! 🙌
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional