web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Suggested Answer

How to convert text into email address in the outlook 365

(0) ShareShare
ReportReport
Posted on by 17
Team,
 
This is the text in the body of an email:
(For the scenario of internal deflagration in the reactors due to ignition of vapors from mechanical sparking of the agitator, the following: Verify the target oxygen 
Start date:
2025-10-15 14:25:28.472
Due date:
2025-11-21

Robinson Dass has an overdue task in the tool. Please click on the link above and log into tool to view the task. The task must be completed by the due date.)
 
I am looking for the step to step flow to look "robinson dass" in the outlook and extract the email address to draft an email.
 
Thanks
 
Robinson
I have the same question (0)
  • Power Platform 1919 Profile Picture
    1,773 on at
    How to convert text into email address in the outlook 365
    Hi ,
    You can get the mention details from graph endpoint :
    sample example: 
     
  • Suggested answer
    Tomac Profile Picture
    3,914 Moderator on at
    How to convert text into email address in the outlook 365
     
    Here's a sample flow that extracts the name and then runs a lookup:
     
    You feed the body of the inbound message into the HTML To Text action to get just the text, then use the following expression to format the name by Last, First
    concat(split(substring(body('Html_to_text'),add(indexOf(body('Html_to_text'),'Due date:'),24),sub(indexOf(body('Html_to_text'),'has an overdue'),add(indexOf(body('Html_to_text'),'Due date:'),25))),' ')[1],', ',split(substring(body('Html_to_text'),add(indexOf(body('Html_to_text'),'Due date:'),24),sub(indexOf(body('Html_to_text'),'has an overdue'),add(indexOf(body('Html_to_text'),'Due date:'),25))),' ')[0])
    That expression is a lot, but try it out. Here it is broken out and formatted nicer:
    concat(
    	split(
    		substring(
    			body('Html_to_text'),
    			add(
    				indexOf(
    					body('Html_to_text'),
    					'Due date:'
    				),
    				24
    			),
    			sub(
    				indexOf(
    					body('Html_to_text'),
    					'has an overdue'
    				),
    				add(
    					indexOf(
    						body('Html_to_text'),
    						'Due date:'
    					),
    					25
    				)
    			)
    		),
    		' '
    	)[1],
    	', ',
    	split(
    		substring(
    			body('Html_to_text'),
    			add(
    				indexOf(
    					body('Html_to_text'),
    					'Due date:'
    				),
    				24
    			),
    			sub(
    				indexOf(
    					body('Html_to_text'),
    					'has an overdue'
    				),
    				add(
    					indexOf(
    						body('Html_to_text'),
    						'Due date:'
    					),
    					25
    				)
    			)
    		),
    		' '
    	)[0],
    )
    In the output of the Search For Users action, you'll have the Mail attribute (if the search was successful) and can use that.
  • RD-01101340-0 Profile Picture
    17 on at
    How to convert text into email address in the outlook 365
    Hi Tomac,
     
    The email was an example. The actual name is Robinson Dass, which appears before "has an overdue task in tool. Can you suggest a workflow to check the text before "has an overdue task in tool" and look the name in the outlook and extract the email address.
  • Tomac Profile Picture
    3,914 Moderator on at
    How to convert text into email address in the outlook 365
    We need to know the text before and after, since names are not a fixed length.
  • RD-01101340-0 Profile Picture
    17 on at
    How to convert text into email address in the outlook 365
    But the name will keep on changing based on the escalation. The only constant statement is "has an overdue task in tool" after the name.
  • Tomac Profile Picture
    3,914 Moderator on at
    How to convert text into email address in the outlook 365
    Yes. My example looks for the text "Due Date:" and adds the characters between that point and the beginning of the name, then finds the end of the name by looking for the next block of fixed text. This allows for a name of any length to be located, by using known and fixed bits of text before and after the name.
     
    If you have a real email that would be sent (with a fake name), we can customize the expression to match those text lengths.
  • RD-01101340-0 Profile Picture
    17 on at
    How to convert text into email address in the outlook 365
    Thanks Tomac, below is the actual email:
    Tool Message:

    Workflow #:
    25
    Form: Implementation
    Title: For the scenario of internal deflagration in the reactors (3.5K. 3K, 1K) due to ignition of EPI vapors from mechanical sparking of the agitator, complete the following: (1) Verify the target oxygen level of <80% is being achieved by measurement in the head
    Start date: 2025-10-15 14:25:28.472
    Due date: 2025-11-21

    Robinson Dass has an overdue task in tool. Please click on the link above and log into tool to view the task. The task must be completed by the due date.
     
    1. Robinson Dass is owner of this tool and he is available in the outlook, which needs to be extracted.
    2. In the entire email "has an overdue task in tool" is constant and the rest of the information will change basis the situation. 
     
    Thanks for your help.
     
  • Suggested answer
    Tomac Profile Picture
    3,914 Moderator on at
    How to convert text into email address in the outlook 365
     
    Looks like the text isn't following the normal Windows standard encoding, so the words "has an overdue" couldn't match when I typed them manually into the expression. Using a copy/paste from your sample made it work perfectly:
     
    concat(split(substring(body('Html_to_text'),add(indexOf(body('Html_to_text'),'Due date:'),24),sub(indexOf(body('Html_to_text'),'has an overdue'),add(indexOf(body('Html_to_text'),'Due date:'),25))),' ')[1],', ',split(substring(body('Html_to_text'),add(indexOf(body('Html_to_text'),'Due date:'),24),sub(indexOf(body('Html_to_text'),'has an overdue'),add(indexOf(body('Html_to_text'),'Due date:'),25))),' ')[0])
     
    Using this code will extract the name in Last, First format when can then be looked up to get the email address.
  • RD-01101340-0 Profile Picture
    17 on at
    How to convert text into email address in the outlook 365
    Thanks Tomac..I was able to create a workflow so far. The next is to look for robinso dass in outlook and forward this email to him with a little email. I will make the content, could you please help me to create the next workflow pls. This conversation is been a best learning so far for me...Thanks:
  • Suggested answer
    Tomac Profile Picture
    3,914 Moderator on at
    How to convert text into email address in the outlook 365
    The next step will be a Search for Users action, followed by a Condition that verifies the user was found:
     
    The expression in the Search For Users action is the one from my previous comment.
     
    The Apply To Each is automatically inserted to use the email address which could be fixed but it's easier this way. The loop will only run once because we set the Top value to 1 in the Search For Users action.
     
    If no users were found, the flow terminates with a custom error message so you can see what happened.
     

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

Coming soon: forum hierarchy changes

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
Tomac Profile Picture

Tomac 544 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 482 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 287

Last 30 days Overall leaderboard