LoveNintex
Canvas Initiate

Strip email address from people picker field

I thought I saw the answer to this question, but after a long time searching, I was not able to find it.  In a workflow,  I'd like to strip/extract the email address  out of the value returned from a people picker field.  I think I can use a regular expression, but am not sure how to configure it.

For example, I'd like to extract daniel.Smith@domain.onmicrosoft.com out of  i:0#.f|membership|daniel.Smith@domain.onmicrosoft.com.

 

Thank you!

 

Labels: (1)
0 Kudos
Reply
2 Replies
LoveNintex
Canvas Initiate

Re: Strip email address from people picker field

I figured it out.  For anyone else who is having the same issue, here is what I did to strip out the text i:0#.f|membership| before the email address.

I used the "Replace Substring in String" action.  My values are as follows:

  • Search String = -1;#i:0#.f|membership| - which is all the text in front of the email address
  • Replace String = (leave this blank)
  • String = varEmailString - This is a text variable that holds the string that you want to remove characters from
  • Output = varEmailString - I used the same variable as my String, but a new text variable can be used.

I hope this helps.

 

 

 

 

 

0 Kudos
Reply
nico
Process Pupil

Re: Strip email address from people picker field

There is a more simple way :

in a "set varaible", use the 'advence lookup', select your SharePoint field, and use select your return type for your SharePoint user Field. You can select the Email, display name, login or user ID.

nico_0-1626880637886.pngnico_1-1626880648620.png

 

 

 

Or and other ways is to extract the Email from the login text with a regex.

The regex is : 

([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+)

 

nico_2-1626880791716.png

 

0 Kudos
Reply