Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Hello there I have a infopath form with Sharepoint workflow attached to it. I want to be able to send an email to a certain person based on what the "users" last name starts with.

So for example:

Person 1 last name starts with A,B,Y that email is sent to cindy@home.com Person 2 last name starts with M through Z email is sent to joe@home.com

I know that I can do "If CurrentItem:LastName begins with value" but I do not know how to set up the value part.

Thanks!

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

You will want to set up a compound condition like this:

If CurrentItem:LastName begins with 'A' or CurrentItem:LastName begins with 'B' or CurrentItem:LastName begins with 'Y' then

See this article for an example of how to set that up. Here are some samples from that article:
Example
This can also be reduced to:
enter image description here

You can also do this as a regular expression for finding one that starts with M-Z. Use the regex variable: ^([M-Z]|[m-z]) which means match any string that starts with any letter m-z upper or lower case. enter image description here

share|improve this answer
    
Ok Great I think that works. But now What about if I want to do a range IE M-Z –  trikread May 8 '13 at 16:41
    
That is where you will want to use regular expressions. See the bottom for the article for an example –  Ryan Erickson May 8 '13 at 16:44
    
I updated the answer with a regex example. Don't forget to mark the answer as accepted if it solved your problem using the check button. –  Ryan Erickson May 8 '13 at 16:50
    
Sorry I guess I do not understand. Where do I add the regEx in the WF? –  trikread May 8 '13 at 16:53
    
Store your regex in a new variable then use the "matches regular expression" operator –  Ryan Erickson May 8 '13 at 16:56
show 3 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.