Thursday, June 30, 2011

Send an email to group of multiple people from designer

SharePoint designer really helps us to simplify a basic need to sending an email with formatting options and by checking conditions.

However when it comes to sending an email to multiple people from list item, then comes the problem. If you have defined a column which is multiuser selection or even a group selection in people picker, that column does not show up in the list of the To in SharePoint designer.

Take an example, I have an assigned to column as a multiple people and group picker.



So if you go to a SharePoint designer and open the send email option and check out workflow lookup field and try to find out this Assigned to column, it does not show up there.



So we cannot send an email to people picker field if we have that field as multi user and group picker.

I have couple of workarounds for this. I will explain both of them. But I would recommend going with second option.

First we need to understand that if you assign hard core values in to TO email section, it sends an email. I mean try to use different users email address and couple of SharePoint Groups or even active directory distribution lists. It sends an email.

So problem is not that SharePoint Designer cannot send an email, the problem is it does not recognize the field which has multi select user or group in it. We have to somehow find a way to tackle this.

So the first option, change your multiple people and group picker to have a single selection and user only. Open workflow designer, change the To field to have a look up to that Assigned to field. Save the workflow. Come back to the list and now again change AssignedTo filed to the multi user and group filed.

So now onwards even if you select different users and groups, it will send an email.

The big problem with this approach is that if you are trying to do this with existing list which already has data in it, then you will run into a problem of losing other users defined in the people picker column. Because when you change multi select to a single user selection, only first user is preserved, rest all will be discarded. So that can be a big loss and almost no one would want this.

This approach works when you are starting fresh with the new list.

So what is the best way? Well, the best way is to use this second option.

In your workflow, define one variable. Call it EMailList and should be of type String.



Ignore other variables, I used them for other reason.

So now in an action assign Assigned to field to this EMailList variable and then use this variable as a workflow look up by taking workflow items.



And you are done. See, how easy that was. Wasn’t it? I know you all will go for second option. But to present ideas that I have is what SharePoint Kings is all about. Isn’t it?

9 comments:

Waseem Khan- SharePoint Technology Consultant said...

Thank you very very much , you solve my problem , i try first method and its working awesome.
Thanks once again
Regard
Waseem khan |SharePoint Developer
Rehman Medical Institute RMI Peshawar

Waseem Khan- SharePoint Technology Consultant said...

Thank you very very much , you solve my problem , i try first method and its working awesome.
Thanks once again
Regard
Waseem khan |SharePoint Developer
Rehman Medical Institute RMI Peshawar

Waseem Khan- SharePoint Technology Consultant said...

Thank you very very much , you solve my problem , i try first method and its working awesome.
Thanks once again
Regard
Waseem khan |SharePoint Developer
Rehman Medical Institute RMI Peshawar

Waseem Khan- SharePoint Technology Consultant said...

Thank you very very much , you solve my problem , i try first method and its working awesome.
Thanks once again
Regard
Waseem khan |SharePoint Developer
Rehman Medical Institute RMI Peshawar

Waseem Khan- SharePoint Technology Consultant said...

thanks you so much it really help me , i am really thank full to you . Now i am able to send email to multiple users.

Waseem Khan- SharePoint Technology Consultant said...

thanks you so much it really help me , i am really thank full to you . Now i am able to send email to multiple users.

Anonymous said...

Wow... Indeed that was easy.. I searched so long for a solution!

Thanks a lot!

Anonymous said...

Thank you for your solution, it just works perfect.

Kyle Barton said...

This is nice blog which easily explain how you can Send an email to group of multiple people without making too much changes in your SharePoint development work.




Share your SharePoint Experiences with us...
As good as the SharePointKings is, we want to make it even better. One of our most valuable sources of input for our Blog Posts comes from ever enthusiastic Visitors/Readers. We welcome every Visitor/Reader to contribute their experiences with SharePoint. It may be in the form of a code stub, snippet, any tips and trick or any crazy thing you have tried with SharePoint.
Send your Articles to sharepointkings@gmail.com with your Profile Summary. We will Post them. The idea is to act as a bridge between you Readers!!!

If anyone would like to have their advertisement posted on this blog, please send us the requirement details to sharepointkings@gmail.com