Jan 16

Method for Populating SharePoint Designer Workflow Email with Multiple Recipients from Contact Selector Control

Tag: Collaboration — January 16, 2009 @ 2:49 pm
Author:

C/D/H Consultant

More about C/D/H
Articles by C/D/H Consultant

On a recent project, I developed a web-based InfoPath form which used a Contact Selector control to allow an end user to choose the recipients of an email that would be sent by a SharePoint Designer workflow.  I was limited in that it needed to be a web-based form and I could not use code to accomplish this.  Due to some limitations with the Contact Selector control in how it promotes to a SharePoint list, I could not simply promote the values from the control to a column, then use that information to populate the email.

After some further research, I came across an older article blog entry by the Microsoft InfoPath Team that used the eval()function.  This method is much simpler and allows me to accomplish the desired function without code and in a web-based InfoPath form.  You can read the entry here.

All you need to do is add a Text Box control and set the default value (xPath):

xdMath:Eval(xdMath:Eval(../my:MultipleRecipients/my:Person, ‘concat(my:AccountId, “;”)’), “..”)

Note: “MultipleRecipients” is the name of the non-repeating group in which I have created the schema for the control.

You then promote this to a column, that you hide from your default view, which the SharePoint Designer workflow can easily “pick up” and use the value(s) to populate the “To” box of the email.

Leave a Reply