cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ReneRovekamp
Frequent Visitor

How to extract an email address from a sharepoint column

Power Automate generates an email when a new item is added to a sharepoint list. In one column we ask for an email adress. Users mostly copy and paste the email adress from other sources. Often the name1 is followed by the Name1@email.nl including brackets.

 

in the email Body I receive only name1

how can I extract name1@email.nl without the brackets to add to the Email body? 

1 ACCEPTED SOLUTION

Accepted Solutions

@ReneRovekamp 

 

Created a sample for you to handle the email value.

1.JPG

2.JPG

 

Expression in the Compose action:

replace(substring(variables('varEmail'),add(indexOf(variables('varEmail'),'<'),1)),'>','')
Process steps in the above stample:
1.  Initialize a variable varEmail with the email value. (In your case, you do not need to do this step as you can use Email field value directly)
2. Initialize a variable varEmailValue with value from varEmail
3. Condition: Checking if varEmail contains < or > symbols.
4. If Yes, placed Compose action to trim the unnecessary characters such as text before and after the email id.
5. Setting the output of the compose varEmailValue variable so that you can use it anywhere you want.
 
Note: The above approach works fine if the Email id field contains just the email without < or > symbols.
 

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

6 REPLIES 6
rsaikrishna
Dual Super User
Dual Super User

@ReneRovekamp 

 

In your example, I do not see brackets in the email account.

 

You can use string function such as "replace" to replace any unwanted characters with space or other characters. You can use replace function as part of expressions. 

 

Give a try and let me know if you have any questions.

 

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.

Thanks. I tried replace Replace (">", ">", "-") but then the whole content of the column is replaced 
What do I do wrong then? 

Hi @ReneRovekamp ,

 

What is the full content? could you please share the full content with us and explain what is the needed content in it so we could better understand you and provide the proper workaround for you.

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

example.png

 

When users copy and paste an email address you will get this (example off course). 

When Power Automate generates an email, you only see 'rene' and I need it to show the full email address.

 

I tried the replace function by replacing the last bracket with an underscore, but then the full content as shown in the picture was replaced by it.

@ReneRovekamp 

 

Created a sample for you to handle the email value.

1.JPG

2.JPG

 

Expression in the Compose action:

replace(substring(variables('varEmail'),add(indexOf(variables('varEmail'),'<'),1)),'>','')
Process steps in the above stample:
1.  Initialize a variable varEmail with the email value. (In your case, you do not need to do this step as you can use Email field value directly)
2. Initialize a variable varEmailValue with value from varEmail
3. Condition: Checking if varEmail contains < or > symbols.
4. If Yes, placed Compose action to trim the unnecessary characters such as text before and after the email id.
5. Setting the output of the compose varEmailValue variable so that you can use it anywhere you want.
 
Note: The above approach works fine if the Email id field contains just the email without < or > symbols.
 

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

thanks a million @rsaikrishna that has done the trick!!!!

You just saved me and my colleagues from a load of irritation 🙂 

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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 (2,138)