cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
deepansh_saxena
Helper I
Helper I

How to parse First Name and Last Name from "From" field in MS Flows.

Hello,

I have a flow which runs when a new email is arrived in shared mail box and creates record in SharePoint. Email is sent by the people who do not belong to my organization. SharePoint list captures the "From" name from the flow which is basically a email ID. My question is how to show the Name portion of the email ID in the view.

 

Updating From field in SP ListUpdating From field in SP ListView shows email ID.View shows email ID.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Rahber
Super User II
Super User II

you can use split to get the first half of the email

 

split(variables('email'),'@')
 
make sure to replace variables('email') with your From variable
 
The split function returns an array so you can wrap it in first to get the first part of email before #
 
first(split(variables('email'),'@'))
 
It would be hard for extracting the first name and last name from emails because not all people have complete names in email address nor they follow a standard
 
Please click Accept as Solution if it resolved your problem or give it a Thumbs Up if it helped you in anyway this will allow other people to search correct solutions effectively.
Thanks,
Rahber
 

View solution in original post

rsaikrishna
Dual Super User
Dual Super User

@deepansh_saxena 

 

As the email is coming from outside your organization, are you sure you will always receive FirstName_LastName@<domain>.com ?

It may not be always the case as email naming convention maintained by other orgs can be different.

 

If you are sure that all the email ids contains the format FirstName_LastName@<domain>.com, then you can use string expressions to truncate after the @ symbol.

 

In your case, you can use the following expression:

replace(substring(triggerBody()?['from'],0,indexOf(triggerBody()?['from'],'@')),'_',' ')

 

With above expression, you can get only name.

 

Regards

Krishna Rachakonda

If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.

View solution in original post

4 REPLIES 4
Rahber
Super User II
Super User II

you can use split to get the first half of the email

 

split(variables('email'),'@')
 
make sure to replace variables('email') with your From variable
 
The split function returns an array so you can wrap it in first to get the first part of email before #
 
first(split(variables('email'),'@'))
 
It would be hard for extracting the first name and last name from emails because not all people have complete names in email address nor they follow a standard
 
Please click Accept as Solution if it resolved your problem or give it a Thumbs Up if it helped you in anyway this will allow other people to search correct solutions effectively.
Thanks,
Rahber
 

View solution in original post

rsaikrishna
Dual Super User
Dual Super User

@deepansh_saxena 

 

As the email is coming from outside your organization, are you sure you will always receive FirstName_LastName@<domain>.com ?

It may not be always the case as email naming convention maintained by other orgs can be different.

 

If you are sure that all the email ids contains the format FirstName_LastName@<domain>.com, then you can use string expressions to truncate after the @ symbol.

 

In your case, you can use the following expression:

replace(substring(triggerBody()?['from'],0,indexOf(triggerBody()?['from'],'@')),'_',' ')

 

With above expression, you can get only name.

 

Regards

Krishna Rachakonda

If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.

View solution in original post

@rsaikrishna works well, thank you.

@Rahber works well, thank you.

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (3,156)