Partager via


Using the Contact Selector Control

(This post applies to InfoPath 2007. If you're using InfoPath 2010, then you should check out this post instead.)

We have seen a number of requests on how to allow a user to enter (or select) a person’s name or logon alias and then validate that user against their Active Directory without using code. This has been especially true in workflow scenarios where User A needs to enter in the name of User B – the next person in the workflow process.

Well, InfoPath 2007 ships with a control called Contact Selector Control that will resolve these issues! You may have seen our older article on the subject; this one aims to dive in deeper.

The Contact Selector control is an ActiveX control but it is a special cased control, in that it can also be used in InfoPath browser forms. To use this control there are specific steps that need to be taken – let’s take a look at those now.

Step 1: Add the Contact Selector control to your Controls Task Pane

1) From the Controls Task Pane click the Add or Remove Custom Controls link

2) Click the Add button

3) On the first screen of the Add Custom Control Wizard select ActiveX control and click Next

4) From the list of controls, choose Contact Selector and click Next

5) Select “Don’t include a .cab file” and click Next

6) For Binding Property select Value and click Next

7) From the Field or group type box choose Field or group (any data type) and click Finish

8) Click Close and then click OK

 

Step 2: Create the data structure for the Contact Selector Control

The Contact Selector control needs to have a specific data structure to work properly – this is documented on the “Items” tab of the Properties screen for the control; however, we’ll include that information here as well.

**IMPORTANT!** Spelling and capitalization must be exactly the same, starting with the “Person” group!

1) Add a non-Repeating Group named: gpContactSelector

2) Add a Repeating Group named: Person

3) Add the following 3 text fields to the Person group: DisplayName, AccountId and AccountType

Step 3: Add and bind the Contact Selector control to the View

1) Drag the gpContactSelector Group to the View and select “Contact Selector” from the list of controls

2) You’re almost done…! :-)

Step 4: Add a secondary data source XML file which specifies the SharePoint server

The Contact Selector control needs to know the “context” of where the user validation should occur. These steps are not necessary if you are only displaying the form in a browser from SharePoint – in this case, it uses the context of the site from where it was provisioned; however, if you are in a mixed client/browser scenario you will need to include this XML file so forms opened in the client can use this functionality.

1) Launch Notepad

2) Copy and paste this one-line XML:

<Context siteUrl="http://<servername>"/>

**NOTE: Replace <servername> with the name of your server

3) Save this as: Context.xml (again – naming and capitalization are important)

4) Add Context.xml as a “Receive” type Secondary Data Connection to your form template and make sure the option “Include the data as a resource file” is enabled

Step 5: Test!

You should now be able to Preview the form, enter a name or logon alias, click the “Check Names” button and resolve the name! Alternatively you could click the “To” button to perform a Search if you do not know the complete name of the user.

One other important point: if this control is something you will use numerous times, this process works great to create a “Contact Selector Template Part” – then you only have to complete these steps one time!

Scott Heim
Support Engineer

Comments

  • Anonymous
    February 28, 2007
    The comment has been removed

  • Anonymous
    February 28, 2007
    Oli, Unfortunately, there is no way to embed a custom ActiveX or any other custom control into a browser-enabled form template. However, there's a workaround: host a browser-enabled InfoPath form in a custom ASPX page by using the XmlFormView control, and place your custom control into that hosting page. Then, configure events between the form and the hosting page appropriately. Good luck, Alex

  • Anonymous
    February 28, 2007
    Hi Alex and thanks for answering quickly... I know you can't embed an ActiveX control in the browser version of the form, but presumably this "Contact Selector Control" implements both an ActiveX interface and a "browser-enabled" interface to work in both the rich client and the forms server environments.  The same way the TextBox control, the Date Picker and all of the other "browser-enabled" InfoPath controls do...  What I'm trying to find out is what interface do I implement and/or which attributes do I decorate my class with so that my custom control will count as "browser-enabled". In case my question is still vague, Bob Mixon and I have posted to the InfoPath newsgroup asking the same question in different terms: http://www.mcse.ms/message2365411.html http://groups.google.com/group/microsoft.public.infopath/browse_thread/thread/f58653663a611ea0/846a8677b0308c25 ...but we didn't manage to get your attention. Your assistance in this matter would be greatly appreciated!

  • Oli
  • Anonymous
    February 28, 2007
    Oli, I'm sorry, there really is absolutely no way to do this. The contact selector is a "private handshake" special case. There aren't any interfaces you could implement. No ActiveX or other custom control will work in a browser form, period. This is currently a by-design restriction; we are carefully considering improving this in v.Next. Try the workaround I mentioned above. Thanks! -Alex

  • Anonymous
    March 01, 2007
    Okay, I have seen this question asked numerous places on the internet and never seen it answered so maybe you guys can help out.      Is it possible to add additional fields to the Contact Selector Control?  DisplayName, AccountID, and AccountName are all helpful but we have use for more than just these particular fields.  I know other fields are out there because when I use the contact selector to search for a user, I see other information about them in the Select Names window.  Items such as Title, Department, etc (which are probably unique to our Active Directory).  Is there any way the Contact Selector can pull these fields as well?

  • Anonymous
    March 12, 2007
    Hi, I believe the only fields that are available are what you get in the data structure. If you need additional A/D type of information, you can get this through .NET code. Thanks! Scott

  • Anonymous
    March 14, 2007
    Hi, i have a browser form (infopath 2007) which is hosted in a share point 2007 form-libary. In the submit options i defined that the form should be submited to a mailaccount. That works well, but in the e-mail the contact selector isn't displayed as text. It's displayed as a blank image, but all other controls (textfield,datefield) are correctly displayed as text. Has someone a solution? I have tried to send the form data as an attachement (in the wizard), but the mail arrives everytime without the attachement. Still another question. Is it possible to make a contact selector in a browser form required? Greetz Luz

  • Anonymous
    March 15, 2007
    Hi Lucian, I am not sure I can reproduce the behavior you are seeing. When I display the form that contains the Contact Selector in the browser and then submit that form via e-mail, in the Preview Pane of Outlook 2007 I don't see a blank image - there just does not appear to be anything there. However, when I actually open that form I see the Contact Selector control - is this what you are seeing or do you actually see a "blank image" of the Contact Selector control? Regarding how to make this field "required" - try this:

  • Remove the "Submit" functionality from the Toolbar (this is an option under Submit Options)
  • Add your own button to the form and set its action to Submit
  • Add Conditional Formatting to the button such that if the DisplayName field from the Contact Selector group is blank, the Submit button is disabled. Scott
  • Anonymous
    March 15, 2007
    Hi Lucian, One additional comment: if you are indeed seeing the same behavior as I, then this is expected. For security reasons, Active content (i.e. ActiveX controls, and the Contact Selector is an ActiveX control) is blocked in the Outlook Preview Pane. Scott

  • Anonymous
    April 09, 2007
    Hi, First, is there any way to limit the Contact Selector options to members of a single SharePoint group or AD group? And second, can I limit the control so the user can only select a single person? Thanks.

  • Anonymous
    April 09, 2007
    Hace unos días estaba trabajando con un formulario en InfoPath que publicaba a una biblioteca dentro...

  • Anonymous
    April 10, 2007
    Hi, I am looking into your question of limiting the Contact Selector options to members of a single SharePoint or AD group; however, in regard to your question of limiting the control so only one user can be selected - you would need to use custom code on the control to perform a "count" of the repeating node. If there is more than one, then throw an error. Here is some sample code: ** NOTE: "group1" is the parent node of the "Person" repeating node. ** public void group1_Validating(object sender, XmlValidatingEventArgs e) { if (e.Operation == XmlOperation.Insert)      {       if (e.Site.SelectChildren(XPathNodeType.Element).Count > 1)            {             e.ReportError(e.Site, false, "User Selection Error!", "Only 1 user can be selected!"); } } } What this will do is add an error to the errors collection if the contact selector contains more than one entry. Because an error is added to the errors collection, the form cannot be submitted. So although this will still “allow” more than one user to be selected, it does present an error to the user.

  • Anonymous
    April 13, 2007
    Hi Scallin, The Contact Selector control is technically not an InfoPath only control so I needed to get a hold of the proper folks to confirm: the Contact Selector control does not have the native ability to restrict users to a single SharePoint or AD group. I would think though that you could write code on the "Validating" event to perform you own validation of what group the selected user is a part of. Scott

  • Anonymous
    April 15, 2007
    Hi, Thanks for the great article, would probably save me lot of work. I have got the control working on my browser form as per your article.  My form is submitting the data to a sharepoint form library, and all is well in that area too.   Now I need to do 2 things: First, I would like to promote the selected contact to a column in sharepoint library.  This is so that the column can be filtered by current user.   second, I would like to pre-fill the control with value that i get from AD using code.  Any comments on that ??  I can access full user details from AD, so the only problem is to fill it properly in the controls data structure. Thanks, Raj

  • Anonymous
    April 16, 2007
    Hi Raj, InfoPath 2007 does not support promotion into a Person or Group field - what may work is to create another node in your data source (it does not need to appear on the view) and set the default value of this to either the Display Name or AccountId field and then promote this field. Obviously this will simply be a text data type and not a Person or Group field. Regarding how to populate the fields appropriately, you will need to set the value of the DisplayName and AccountId fields. The AccoundId is merely domainuser; however, in my testing it appears this is case-sensitive. As an example, the following does work for me: domainuser But what appeared in the Display Name field was: "FirstName LastName <domainuser>" Whereas when I changed this to: DOMAINuser Then the only thing that appeared in the Display Name field was: "FirstName LastName" I would suggest for testing that you simply drag the Person group to your view as a Repeating Section with Controls, select a value using the Contact Selector control and you will see how these fields are populated. Scott

  • Anonymous
    April 16, 2007
    Hi, "One other important point: if this control is something you will use numerous times, this process works great to create a “Contact Selector Template Part” – then you only have to complete these steps one time!" There is only one problem with this great idea and that is that ActiveX controls are not supported in template parts. At least that is what it says when I try. Andy

  • Anonymous
    April 16, 2007
    Hi Andy, My apologies for the confusion - what I was referring to was the process of creating the data structure needed for the Contact Selector control. You are correct - ActiveX controls are not supported but you can create the data structure so that all you need to do is add that template part to your new XSN and bind the Contact Selector control to that data structure. Scott

  • Anonymous
    April 16, 2007
    Hi Scott, Thanks for the reply, I figured out by trial and error on how to pre-populate the control, the same way that you mentioned. But still one of my problem remains.  What i need to do is perform a basic workflow on the submitted form.  Once the form is submitted, it is assigned to the user selected from the contact selector.  This part is done.  What i want to provide is the view to users so that they can only see the forms submitted to them.  I tried putting all possible values in the fileld (username, domainusername etc), but it still would not filter with [Me] or [Current User].  Is there any way to do this kind of filtering ??? Thanks for your help, Raj

  • Anonymous
    April 16, 2007
    Hi Raj, Not trying to "pass the buck" on this but the filtering functionality is a feature of SharePoint - if this is not working as you need, you would probably be better served to post that question to one of the SharePoint groups. Scott

  • Anonymous
    April 20, 2007
    Is it possible to use the Contact Selector control on clients that only have InfoPath 2003 installed?  I have created a form in InfoPath 2007 and would like to allow users with only 2003 version to use it.  (Distribute/install the ActiveX control without having to install Office 2007?) -Thanks, Scott

  • Anonymous
    April 26, 2007
    Hi Scott, This is not a supported scenario - the Contact Selector control requires some 2007 files hence your users will need to have Office/InfoPath 2007 installed on their machines. Scott

  • Anonymous
    May 05, 2007
    The comment has been removed

  • Anonymous
    May 05, 2007
    The comment has been removed

  • Anonymous
    May 21, 2007
    Very Cool Control! But.... :-) How does one utilize more than one Contact Selector control on a form?

  • Anonymous
    May 22, 2007
    Hi neoearth, Assuming you have followed the naming conventions in this post, you have a group node named: gpContactSelector under the "myFields" node. To utilize another Contact Selector control:

  • Add a new group node under myFields named, for example, gpContactSelectorNew
  • Expand the existing gpContactSelector node
  • Right-click on the Person repeating node and choose Reference
  • Select the new group node, gpContactSelectorNew, and click OK
  • You should now see the Person node under gpContactSelectorNew - simply drag gpContactSelectorNew to your view and select Contact Selector! Scott
  • Anonymous
    May 23, 2007
    Hi Scott, Following up on the discussion regarding adding more than one Contact Selector Control to a form, I have a form and am trying to:
  • Add more than one (2 specifically...lets call them csA and csB) CS ctrl to each form, and
  • Perform a "required field" validation against both of these I've tried to implement this logic by using the technique you discussed on March 15 (remove the default form Submit feature & control the submit through a custom submit button with some conditional formatting). However, it doesn't work: when trying to make conditional formatting references to the 2 seperate DisplayName fields within the 2 seperate Person nodes of both the csA and csB contact selectors respectively, filling in either contact selector will cause the submit button to become enabled. In addition, we've tried other techniques, such as checking for fields (marked as required) associated with specific Person nodes, copying data to them using rules, and setting the default values to DisplayName node, amongst others. None of them seem to work (most of the form rules and field updates seem to trigger on submit, which is too late). Do you know, or can think of any way we can host more than one Contact Selector on a form and perform "required field" validation against both?? Loving the blog, and thanks for your help in advance! Cheers, Brett
  • Anonymous
    May 24, 2007
    The comment has been removed

  • Anonymous
    May 24, 2007
    Hi Scott, No, you're doing it right, I'm an idiot! I just realised that the behaviour was not actually due to the contact selectors, but to something else I'd left in my overly complicated form from when I was trying to get it to work. When I replicated your test on a fresh form, it worked great!! Sorry I ever doubted! :) FYI, I've noticed that this technique will only work on the "first use" of the control; if you populate the control, and later clear it, required field validation will not be able to pick up the change, obviously because the DisplayName node still holds a value. It's not easy to clean this up without reverting to custom code, is it? Thank you very much for you timely help and assistance! Now loving the InfoPath blog even more!! All best, Brett  :)

  • Anonymous
    May 25, 2007
    Hi Brett, Glad you were able to isolate the problem! In regard to what happens after you clear the user from the CS control, you can better see this by dragging the "Person" node to your View as well. When you enter a user in the CS control and click the button to validate the user, you will see the associated fields get filled in; however, when you simply clear that user from the CS control those fields do not get cleared until you validate the user. Now - at that point, not only do those fields get cleared the node gets removed entirely. So, to make this work you will need to modify the Conditional Formatting on the button: Display Name is blank (for the first CS) (or) (Choose The Expression) count(my:group1/my:Person) = 0 (or) Display Name is blank (for the second CS) (or) (Choose The Expression) count(my:group2/my:Person) = 0 What this will do is disable the button when: either control is blank or once you delete the user and click the button to validate the user. Short of this, you would need to write code to see if anything else would work. Scott

  • Anonymous
    June 19, 2007
    The contact selector control in InfoPath 2007 is quite handy for users to select a person from active

  • Anonymous
    June 21, 2007
    Hi, Thanks for the wonderful tips on the Contacts Selector. I have used a contacts selector on a form and it works fine. However, I need the form to be submitted to a document library with a name generated from the user's name, and a link to the saved document to be sent to the person selected on the contacts. When using infopath, this works fine but when i publish the form and fill on the browser, it saves in the library but does not send e-mail. I am submitting the form using a rule that uses 2 data connections, 1 to submit to the library and 1 to e-mail. What could be the problem is not submitted to e-mail from the browser?

  • Anonymous
    June 21, 2007
    Hi levy, Keep in mind, when sending mail from a browser form it will be sent via the mail services setup on the server. Have you setup SMTP mail? If so, have you confirmed it is working? For example, can you add an "alert" to a list and actually get that mail? Scott

  • Anonymous
    June 21, 2007
    Hi Scott, SMTP is currently configured on the server e-mails/alerts are going through. i just added an alert and received the notification

  • Anonymous
    June 21, 2007
    The comment has been removed

  • Anonymous
    June 21, 2007
    Seems like it should work - is there anything in your Application Event log or the SharePoint server logs or the SMTP service logs that would provide a clue? Scott

  • Anonymous
    July 11, 2007
    環境: Microsoft Office SharePoint Server (MOSS) 2007 Visual Studio 2005 SharePoint Server 2007 SDK and

  • Anonymous
    July 11, 2007
    環境: Microsoft Office SharePoint Server (MOSS) 2007 Visual Studio 2005 SharePoint Server 2007 SDK and

  • Anonymous
    July 27, 2007
    Hi Scott, Question on resolving lastname, firstname in the contact selector.  I am populating this control via a database with a name and am having problems getting the name to resolve.  Even though the name should resolve it is only looking at the last name then automatically entering a semicolon -   lastname; firstname.  It is treating it as 2 different names.  I need this to resolve by populating the person's name so the person submitting the form can see who it's going to. I am using the GUI to design this browser form.  Please help!   thanks!

  • Anonymous
    August 02, 2007
    Hi cfarkal, As you have probably tested, it is not just when you programmatically set the name as: last, first - if you just type it in this way it does not resolve. The Contact Selector control is technically a SharePoint control and without debugging into the control, I am not sure why it does not like the name in this format. So - why not just format the name as: first last? Here is some sample code: XmlNamespaceManager ns = this.NamespaceManager; XPathNavigator xnDoc = this.MainDataSource.CreateNavigator(); XPathNavigator xnCS = xnDoc.SelectSingleNode("/my:myFields/my:gpTasks/my:gpTask/my:gpContactSelector/my:Person/my:DisplayName", ns); string strName = "Heim, Scott"; int intLoc = strName.IndexOf(","); string strFormattedName = strName.Substring(intLoc + 2) + ' ' + strName.Substring(0, intLoc); xnCS.SetValue(strFormattedName); Scott

  • Anonymous
    August 08, 2007
    Hi Scott, Excellent article! In the last paragraph, you suggested we could create a template part using the Contact Selector but I get "ActiveX controls are not allowed in Template parts" error when I try to add contact selector to the form. Could you kindly elaborate on how we can add contact selector to the template part? Thanks, Daska

  • Anonymous
    August 08, 2007
    Hi Daska, Yes - I should have been more clear on this - my apologies. What I was referring to was creating a template part of the "data source" - this way you don't have to keep recreating this each time. You can just add the template part containing the data source and just drag it to your View (it shows as a section.) Once there, just right-click on the Section choose Change To and choose Contact Selector! Saves a fair amount of time... Scott

  • Anonymous
    August 08, 2007
    Thanks for the quick response Scott! I really appreciate it. It works but now the problem is that entering a value in one control shows that value in other controls too. For example, if i use the template part multiple times on the same form, then entering the value in one control populates all the controls on the form. How can I resolve this? I will appreciate your feedback on this. Thank you very much. Daska

  • Anonymous
    August 08, 2007
    Ah - now that is a bit different! :) To use multiple Contact Selector controls, you would need to do this:

  • Add the Template Part once to your View and change it to a Contact Selector control as noted before
  • To add another one:     - In the Data Source Task Pane, right-click on myFields and choose Add     - Enter a name (i.e. CS2) and set the Type to Group (NOT repeating)     - Expand the Template Part data source, right-click on the top group (i.e. gpContactSelector) and choose Reference     - Select the new CS2 group and click OK. The appropriate data structure is added for you! Now, just drag the new gpContactSelector to the View and choose Contact Selector control. Scott
  • Anonymous
    August 09, 2007
    Thank you very much Scott. It worked. Regards, Daska

  • Anonymous
    August 09, 2007
    Hi Scott I have a problem. I am publishing the InfoPath form (with contact selector control) in a SharePoint library. The value selected in the contact selector control does not appear in the SharePoint library. I have been trying to find the solution since morning but with no luck. While publishing 'DisplayName', i select 'first' function from the list of available functions. The 'DisplayName' property is created in the library but the value does not show. Any ideas? Thanks, Daska

  • Anonymous
    August 09, 2007
    Hi Daska, That's odd - this works perfectly for me. In fact, I added both "Display Name" and "Account Id" as promoted columns and I see both get populated when I submit or save the form to the library. For testing purposes, create a new form template with just one Contact Selector control and see if this works for you. If so, let me know what is different that is not working for you. Scott

  • Anonymous
    August 09, 2007
    Is there any possibility that this might be happening because I am not on a domain? I am using a virtual PC and I am not on a domain. I am logged in as a local machine admin. Thanks, Daska

  • Anonymous
    August 10, 2007
    Hi Daska, I am not sure - that may be the cause. I would test with just the form template created in this post just to be sure. Scott

  • Anonymous
    August 30, 2007
    Scott: We are using the Contact Selector control on an InfoPath form that is being used as a Workflow Task form in a SharePoint 2007 workflow.   The portal users are members of an Active Directory group named "Portal Members" and this group is a member of a SharePoint Site Group.  The Contact Selector will allow the user to select anyone in the "Portal Members" group but unless the person selected is in the "All People" list on the portal they don't actually get assigned to the workflow task.   I'm not sure if this is an InfoPath problem or a Workflow problem - any insight would be greatly apprceiated. Thank you, Josh

  • Anonymous
    August 30, 2007
    Hi Josh, Actually this is a SharePoint control - I would suggest starting with that group. It may be a workflow issue but I am not sure. Scott

  • Anonymous
    September 24, 2007
    Body: Para que septiembre no se vaya en blanco, aqui les comparto algo que nos anduvo dando algunos dolores

  • Anonymous
    September 24, 2007
    Para que septiembre no se vaya en blanco, aqui les comparto algo que nos anduvo dando algunos dolores

  • Anonymous
    October 07, 2007
    Hi all! I made a contact selector. I want to select one ore more users, get their DisplayName and AccountID. So far ok, but now, I want to add a CheckBox and a Dropdownlist to each selected Person. So I want to extend my contact selector so, that I can fill these extra fields. If I add these controls to the Contact Selector, these fields are dimmed, I cannot type in or select any values. How can I do this using an other way?

  • Anonymous
    October 08, 2007
    The comment has been removed

  • Anonymous
    October 08, 2007
    Hi! Thanx for the feedback, but it is not exactly what I wanted to do. :( So: I have a contact selector. I fill this with names for example: marci737;infopath;chuck;teddy. The names are separated with ";". When I validate them, I want them to appear in a new repeating table so:


displayname accountid accounttype dropdownlist checkbox

displayname accountid accounttype dropdownlist checkbox

displayname accountid accounttype dropdownlist checkbox This would be the input for the next form.

  • Anonymous
    October 09, 2007
    Hi marci737, There is no way in the UI to accomplish this - you will need to write custom code to accomplish what you are asking. Scott

  • Anonymous
    October 10, 2007
    This works great for me - however, how do I set the default to be the current user?  I know where to do this... DisplayName, right click properties, default.  I just don't the formula or the value to put in there.

  • Anonymous
    October 10, 2007
    The comment has been removed

  • Anonymous
    October 10, 2007
    Wow, lots of information here, thank you!  I followed your instructions exactly and everything you said was where it was supposed to be, very impressive.   It appears to be working by doing the user check, but how do I get the default value to read the Current User who is filling out the form?

  • Anonymous
    October 10, 2007
    Hi caseycase, Glad that helped! Try this:

  • Remove the hard-coded user name from the default value
  • Click the "fx" button
  • Click the Insert Function button
  • Select the All category
  • Scroll to the bottom of the Functions list and select userName
  • Click OK until you are back to your form
  • Test! :) Scott
  • Anonymous
    October 10, 2007
    That worked!  Thank you very much - thank you especially for responding so quickly.

  • Anonymous
    October 10, 2007
    Glad to help! Scott

  • Anonymous
    October 15, 2007
    Hi arttu_123, In regard to your question of using the Contact Selector control in a Document Information Panel - I don't know that I am seeing the same results. Here are the steps I followed:

  • Created a new Document Library named: ContactSelectorTest
  • Enabled the option: Allow management of content types
  • Added a new column to this library named: Responsibilities and set the data type to Person or Group
  • Clicked the Document Content Type and selected Document Information Panel settings
  • Clicked Create a new custom template
  • Reviewed the data source and it matched what you are seeing: p:properties  :documentManagement     ns2:Responsibilities        UserInfo           DisplayName           AccountId           AccountType
  • Published this back to my library as a Document Information Panel (default option)
  • Clicked New to create a new Word document
  • Entered my user name in the Contact Selector control and clicked the "Check Names" button - result: resolved my name
  • Clicked the Add people from Address Book button, entered a co-workers user name, clicked the Go button, selected that user, clicked Add and then OK - result: that user's name was displayed in the Contact Selector control. Am I doing something differently than what you are trying to accomplish? Scott
  • Anonymous
    October 15, 2007
    Hi, Brilliant post, helped me loada already! :) Relly annoying that you can't promote to a person or group field in SP however.. So I wondered is there a way to get the actual email address instead of the account ID or display name? I think this would look better in a column instead of the account ID.. but is it possible? :) Thanks!

  • Anonymous
    October 16, 2007
    Hi thunderstorm, The Contact Selector control will only be able to obtain the data for those fields that you see in the data source. You may be able to use the value returned in the AccountId field to query your Active Directory to return this information. The other possibility is if you have a configured profile database, pull the information from here as well. Scott

  • Anonymous
    October 16, 2007
    The comment has been removed

  • Anonymous
    October 17, 2007
    Hi Anca, Does the same error occur if you simply double-click (launch) the InfoPath form outside of your workflow? I just want to be sure this is not specific to your workflow process. In short, it sounds like you are maybe using code to reference one or more nodes and have not declared the appropriate namespace. Scott

  • Anonymous
    October 17, 2007
    Hi Scott, Sorry I was so brief in my last post. Basically I tried to deploy the form in a non workflow context, just publish the form and then test it. It works (both in infopath and browser) , so it's not something strictly related to the form ! In the stack trace I can see that AppendChild() is called and with that also NamespaceLookup() and that is where the exception gets thrown. I don't really understand because the same methods are called when I test my form in a non workflow related environment, and it works. Thanks, Anca

  • Anonymous
    October 17, 2007
    The comment has been removed

  • Anonymous
    October 17, 2007
    Anca - have you added custom code to your form? Are you 100% sure this code gets executed in a non-workflow scenario? Sebastian - what happens if you create a new test document library and attempt to create a new custom template - do you still get the error? I am wondering if this is site or library specific? Scott

  • Anonymous
    October 17, 2007
    Hello Scott! Ah yes, it does actually work when I create a new document library in the same site. Well I guess this solves my problems then, a bit work to add all the columns and content types to the new library, but nothing too much. The cause of that error still eludes me though. But hey, all that matters is that it's working now :) Thank you Sebastian

  • Anonymous
    October 17, 2007
    Hello again, I actually figured out why I kept getting that error message when trying to create a new custom template in a document library. One of my custom content types used in that document library uses two lookup colums which get the information from another list in my sharepoint site. For some reason when I create a new template, InfoPath sets the data source for those columns as a list named just "list_", and it only has a value @ID, nothing else. And when I had those two lookup columns in one content type they both used the dataObject name 'list_'.. hence the "'list_' is a duplicate key for the unique Identity Constraint" error. I can get it properly working when I remove the second lookup column from the content type and manually readjust the data source of the first lookup column after "Create a new custom column". Do you think this is a bug or just something with my site collection? In short: I have two sharepoint lists and one document library with a custom document content type that has lookup columns to fetch information from those lists. InfoPath sets the data source for these columns wrong, when trying to create a new DIP template for the document content type.

  • Anonymous
    October 18, 2007
    Hello Scott, No, my form has no custom code in it. My form only has a contact selector configured as you described it here, and a Submit button. I designed this simple form to use it in order to reassign a task to another person in a workflow. So when I try to add a contact in the control it shows me that error. I'm sure it works in a non workflow context. Thanks, Anca

  • Anonymous
    October 18, 2007
    Sebastian - that is great to hear that a new library works. Like you, it is interesting as to why the original did not but at this point, it is probably not worth spending a lot of time trying to isolate the cause. arttu_123 - thank you for the update! I am not sure if this would be expected or not - if you would like to pursue this, I would suggest opening a support case and please provide us with the steps to reproduce the behavior. It sounds like it could be an issue so we should probably look into this further. anca_accenture - thank you for the additional information. Can you confirm something for me: if you remove the Contact Selector control from the form, it then works in your workflow? Thanks all, Scott

  • Anonymous
    October 22, 2007
    Hi Scott - I need help with throwing an error message to the user when they try to enter multiple contacts.  I read your blog entry where this was covered above - however, I am not sure where to put the code.  Would this be part of the Submit options?  I couldn't find a place in there either. thanks

  • Anonymous
    October 22, 2007
    Hi caseycase, The code shows where it goes: ** NOTE: "group1" is the parent node of the "Person" repeating node. ** public void group1_Validating(object sender, XmlValidatingEventArgs e) { if (e.Operation == XmlOperation.Insert)     {      if (e.Site.SelectChildren(XPathNodeType.Element).Count > 1)           {            e.ReportError(e.Site, false, "User Selection Error!", "Only 1 user can be selected!"); } } } Using the sample from the post, "group1" is the parent node of the "Person" repeating node. So as you see in the code, there is a "Validating"event on group1. What you need to do is:

  • Display the Data Source Task Pane
  • Right-click on group1, select Programming and then choose Validating Event You will then get an empty event. Add the following code to that event: if (e.Operation == XmlOperation.Insert)     {      if (e.Site.SelectChildren(XPathNodeType.Element).Count > 1)           {            e.ReportError(e.Site, false, "User Selection Error!", "Only 1 user can be selected!"); } } Scott
  • Anonymous
    October 23, 2007
    Thanks, I will try it, right now this option is grayed out until I get the VSTA downloaded and I am unsuccessful in doing so, I keep getting redirected to all kinds of links. On another note, during form field promotion, I am trying to promote one of the fields in the gpContactSelector to an existing site column called Associate Name that will show Presence.  I am trying to merge the DisplayName into the Associate Name column and receive this error: "The data type of the selected site column does not match the data type of the field to promote" - I also tried AccountId and AccountType, none of them work.   Do you know a workaround?

  • Anonymous
    October 23, 2007
    Hi caseycase, Unfortunately I don't know of a workaround other that what I suggested earlier in this blog - the difference is that field will simply be a text field containing the AccountId or DisplayName of the user, which means Presence will not be available. Scott

  • Anonymous
    October 24, 2007
    Para que septiembre no se vaya en blanco, aqui les comparto algo que nos anduvo dando algunos dolores...

  • Anonymous
    November 01, 2007
    I added the Contact Selector web part to a browser form, and I can select users properly from the sharepoint hosted environment. However when I go to send an email using the contactSelector group as the data field, it tries sending to lastname@domain.com instead of the proper ad email address which is first.lastname@domain.com, am I pointing to the wrong part of the datasource or am I doing something wrong here? Thanks Maarten

  • Anonymous
    November 02, 2007
    Hi Maarten, When you select a user in the Contact Selector, is the name returned as first.lastname in the control? Also - drag that node onto your view as a Section with controls so you can see each node and make sure DisplayName and AccountId show the same information. Scott

  • Anonymous
    November 27, 2007
    Hello InfoPath Gurus, I am following the directions you outlined for caseycase above and the Contact Selector automatically populates with the resolved name to the current user when the form is opened (Perfect, thanks.). The problem I’m experiencing is when a user enters a new name and resolves it, the returned value is: <currentUser> <newName>, even if the current user value is cleared from the Contact Selector before the new name is entered. Is your solution above meant to allow for a different name to be entered (the traditional use of the Contact Selector) or does it limit the control to the current user with appended names? Thank you for any information you can provide. - K

  • Anonymous
    November 28, 2007
    Hi Kristina, I see what you are saying...sorry about that. Try these modifications:

  • Remove the userName() function from the DisplayName field
  • From the Tools menu choose Form Options -> Open and Save category
  • Click Rules (you should see one rule created above)
  • Click Modify
  • Click Add Action     - Action: Set a field's value     - Field: Pick the DisplayName field from your main data source     - Value: Click the "fx" button and insert the userName() function
  • Make sure this new action is the first item in the list of actions This will still populate the "default" value to be the user that opened the form but if the user enters a new value in the control, it now appears to resolve correctly. Scott
  • Anonymous
    November 28, 2007
    Hello Scott, Your solution seems to work fine until I apply the validation code that you supplied above for limiting the control to a single entry. Somehow the ResolvePrincipals method is incrementing the person count on the Contact Selector, and not showing the accurate count after the first person is removed and replaced. Is there a way to force the count back down to 0 when the field is cleared? Thanks again for all your help. – K

  • Anonymous
    November 29, 2007
    Hi Kristina, I don't believe I am seeing the same behavior - here is what I tested:

  • Made the modifications noted above to the Rule on the Form Open
  • Added the code to insure only 1 user could be added
  • Launched the form - result: my user name is populated and resolved
  • Deleted myself from the Contact Selector and entered a co-workers name
  • Clicked the Check Names button - result: name is resolved and no error about the number of users Am I doing something different? Scott
  • Anonymous
    November 29, 2007
    I apologize Scott, Somehow I was applying the validation code to the “Person” group rather than the Contact Selector group. I was too quick to post. Sorry! :-) This is a great thread. Thank you for responding so quickly and thoroughly. InfoPath can be a bear for beginners, but it would be impossible without these forums. Thanks again. – K

  • Anonymous
    November 29, 2007
    No problem - I am glad it works for you! Scott

  • Anonymous
    January 04, 2008
    Hi. I have problems when I try use CS with TNS name space. Do You know how fix it?

  • Anonymous
    January 04, 2008
    Hi ing_marco, A few more details would be helpful. What have you done so far, what error are you receiving, does this sample even work, etc. Scott

  • Anonymous
    January 09, 2008
    In part one I created an InfoPath form that employees could use to create a work schedule. Now I&#39;m

  • Anonymous
    January 24, 2008
    The comment has been removed

  • Anonymous
    January 24, 2008
    Hi rjburke, You will probably be better served posting that question to a SharePoint Newsgroup. Scott

  • Anonymous
    February 18, 2008
    Hello Scott, I have a problem using the contact selector control in DIP for a content type. The contact selector works fine when the DIP is generated from scratch using sharepoint content type management UI, but it doesn't work when the DIP is modified from parent content type DIP. In my scenario I have a tree of content types going from very generic ones to very specific ones. Since the generic (parent) content type already contains some code and external data connections, I do not want to recreate the DIP for each child content type from scratch, but instead I just want to modify the parent content type DIP. Unfortunately, if the child content type contains a new field of user/group type and I follow instructions in your article to add the contact selector control, I can select a specified user but the value doesn't bind. I think that the problem lies in the fact that the top level node is called UserInfo instead of Person. When the DIP is created from the scratch there must be some internal plumbing going on which resolves this issue.

  • Anonymous
    February 18, 2008
    Hi dtrodler, Correct - that repeating node must be called Person in order for this to work correctly. Scott

  • Anonymous
    February 18, 2008
    Hello Scott, thanks for the prompt reply. Is there any workaround? The DIP schema is read-only and I cannot rename that node. I think that reusing DIP from parent content type in child content types is quite common scenario and it would be nice to know how to use the contact selector in this case. Can you give me some information how it is done when the DIP is generated from scratch in sharepoint UI? The contact selector works in this case even when the repeating node is called UserInfo . I guess that some modification of the DIP form source files would help. Is there any documentation on this? Daniel

  • Anonymous
    February 18, 2008
    Hello Scott, When I type in a keyword and click Go I get: Search Failed. I have my Context.xml file pointing to my sharepoint site. We are currently using Microsoft Windows SharePoint Services 2.0 with InfoPath 2007. Any Ideas? Thanks!

  • Anonymous
    February 18, 2008
    Hello Scott, I think I have found a workaround for the "non-binding contact selector in derived DIP" problem.

  1.  Create content type A and generate its DIP using sharepoint UI (click "create new custom template")
  2. Modify the DIP as desired by adding external data connections, code etc..
  3. Create content type B which derives from A and has an additional field of type user
  4. Create its DIP by modifying A content type DIP (in sharepoint UI click "edit this template" instead of "create new custom template")
  5. In Infopath designer select "Convert Main Data Source" to update the schema to match the B content type
  6. Place the contact selector control on the form and bind it to your user field. (to the group node above the repeating UserInfo node)
  7. Save the B DIP form source files to "BDIPfromParent" folder
  8. Go to sharepoint UI and generate DIP for content type B again, this time from scratch (by clicking "create new custom template") - this will generate DIP with working contact selector control (but unfortunately all A content type DIP design is lost)
  9. Save the source files of this DIP form to "BDIPfromScratch" folder
  10. Open the file view2.xsl which is the stylesheet for the document management fields from the BDIPfromScratch folder and locate the contact selector control node (clsid:61e40d31-993d-4777-8fa0-19ca59b6d0bb)
  11. Copy the entire param section of this node
  12. Open the view2.xsl file from the  BDIPfromParent folder and located the contact selector control
  13. Replace the param section with the copied section.
  14. Make sure that the namespace prefix used in individual parameters corresponds to the same namespace as in the BDIPfromScratch view2.xsl 15 Open the resulting form (by opening the manifest file in infopath) and publish it as a DIP for the B content type - you should have a working contact selector with your parent content type DIP design preserved! Daniel
  • Anonymous
    February 19, 2008
    Hi Daniel, Glad you were able to get a workaround! Scott

  • Anonymous
    February 19, 2008
    Hello Scott, I sent a message yesterday. Here's more information. We are in the process of upgrading to SharePoint 2007. We are currently using SharePoint Services 2.0. Followed the information above to build the contact selector control but It's not making a data connection. The error I get is "Search Failed". I have administrator access to the site. I've tried it on a blank template, with the same results. Will this work with SharePoint Services 2.0 or do I need to wait until we upgrade? As a rookie the team blog has be very helpful! Thanks, Mike

  • Anonymous
    February 19, 2008
    Hi Mike, To be honest, I think this is new functionality to 3.0. I don't have a 2.0 server to test at the moment...do you have the Contact Selector (may be called the People Picker) control in 2.0? Scott

  • Anonymous
    February 19, 2008
    Hi Scott, Thanks for the reply. We are using InfoPath 2007. I was able to set up the Contact Selector Control, but it doesn't look like the custom data connection using context.xml file is working. In SharePoint 2.0 I don't see a people picker control. Although, I can create a lookup field that pulls user information using the built-in functions. I have a SharePoint 3.0 server setup in the lab I'll see if it works there... Thanks, Mike

  • Anonymous
    February 20, 2008
    I've followed all the steps listed and the contact selector just displays Search Failed each time.  What else could I be doing wrong? Are there any reasons known why the search would fail? Thanks, Liz

  • Anonymous
    February 20, 2008
    Hi Liz, Where does it show the Search Failed? Also - you will want to make sure this works directly from SharePoint. Try these steps:

  • Create a new document library for Word
  • Add a new column to this library as a Person or Group column
  • Create a new document by clicking the New button and just save this to the library
  • Select the saved document and from the dropdown choose Edit Properties
  • You should now see the Person column you created - perform the same search you did using the Contact Selector control...what is the result? If it is still Search Failed then this is an issue with SharePoint and I don't have enough knowledge in SharePoint to troubleshoot that issue. If it works - then did you specify the correct site URL in the Context.xml file? Scott
  • Anonymous
    February 20, 2008
    The comment has been removed

  • Anonymous
    February 21, 2008
    Hi maldrak, Unfortunately I don't know what would be causing this behavior. I never tested these steps with workflow forms so you may want to post this question to a workflow forum or contact Product Support (for Office Workflow) for assistance. Scott

  • Anonymous
    February 26, 2008
    Hello, I am Ara. I am trying to use the contact Selector AcitveX control on browser enabled Infopath form. I followed your steps, and pulished it to a form library on MOSS2007 wich "Enable this form to be filled out by using a browser" cheked. The I can't open the form from the form library on SharePoint. Error says "Unknow error". Do you have any tips??? Please help me.

  • Anonymous
    February 26, 2008
    The comment has been removed

  • Anonymous
    February 27, 2008
    Hello Scott, Yes, I can publish this form to form library successfully. And if I delete the contact selector control, I can open my form from sharepoint. Thank you for your help. Ara

  • Anonymous
    February 28, 2008
    Hi Ara, Have you followed the steps in this post exactly or are you creating your XSN from an external source (i.e. a schema file, database, etc.)? Not that it should not work but I have not experienced this issue when following the steps in this post. If you have indeed followed these exactly, please reproduce the error again and take a look at the SharePoint ULS logs to see if there is anything in there regarding the loading of your form. (NOTE: You may need to enable "Verbose logging" for the various Forms Services categories.) Scott

  • Anonymous
    February 28, 2008
    The comment has been removed

  • Anonymous
    February 28, 2008
    Hi Gus, In the future, please keep questions and comments specific to the post. 1A: You would need to either write code behind InfoPath so you can send a custom CAML query or you can create a custom web service that uses a CAML query to return what you need - this way you don't need code behind InfoPath. 1B: Don't return this many records - see 1A! :) 2A: Make sure your data connections are not set to get the data when the form loads or you can look at caching the results for offline use. (Tools - Form Options - Offline.) 2B: No - unless you use a browser form - then they would need access to the site where you are hosting the form. Like you have said, these are really not simple questions but I have provided "simple" answers. In reality, these will probably be more involved. You may want to poke around the InfoPath Newsgroups and see what others are doing or create a support incident where you can review this with an InfoPath Support Engineer. Scott

  • Anonymous
    February 29, 2008
    Hi Scott, Thanks for the reply..  I am sorry for posting here, but it looked (at least to me) like similar topic.  Anyway, in the future I will try to find a closer fit. Thanks Again, Gus

  • Anonymous
    March 05, 2008
    does this ContactSelector activex works on browser-enabled InfoPath form? Thanks, John

  • Anonymous
    March 05, 2008
    Hi John, Yes - what you will probably have to do is set the Comptibility of your XSN to just InfoPath, add the Contact Selector control and then reset the Compatibility back to InfoPath and Forms Services. Scott

  • Anonymous
    March 31, 2008
    Hi Scott, I am having a couple of problems. I followed every detail and when I tried searching for name it would pull up the names relevent to the search but then after selecting it the selector just goes inactive/blank. When I tried entering a name and checking it... it just goes inactive/blank. I started over, step by step, and noticed Step 3 "Drag the gpContactSelector Group to the View and select “Contact Selector” from the list of controls". When I try that there is no option for selecting the Contact Selector. I am trying to set up a form that will be used as you stated "This has been especially true in workflow scenarios where User A needs to enter in the name of User B – the next person in the workflow process." So after the Supervisor is selected a email or task can be assigned. I am further hoping that the content of the selector can be referenced to assign a user role to grant access to conditional controls. And to send the user to a column in a SharePoint. Your help will be much appreciated. Best Regards, Jason

  • Anonymous
    March 31, 2008
    Plus on Step 4 of Step 4 it says "

  1. Add Context.xml as a “Receive” type Secondary Data Connection to your form template and make sure the option “Include the data as a resource file” is enabled I do not see this option. There is however an "Automatically retrieve data when form is open" Option and you can select resource files and browse to the Context.xml file to include it in the template on the first screen for adding a Data Connection. V/R, Jason
  • Anonymous
    April 01, 2008
    Hi Jason, The first thing I would suggest you verify is that the spelling/capitalization is correct in the data source for the Contact Selector control. Also - make sure the URL you reference in the XML file is valid for your site. Regarding your reference to step #4 - the steps you describe are correct: browse for the XML file and then make sure it gets included as a resource file. Scott

  • Anonymous
    April 01, 2008
    Hi Scott, I had the following wrong: AccountId was AccountID and the binding was set to Person instead of gpContactSelector The option to select the Contact Selector resolved itself when the above were fixed. I am still having a challenge getting the form to reference the user selected for a user role. I am trying the 3 different values: DisplayName, AccountId and AccountType. We'll see what happens... AccountId WORKED! Thanks... now all I need to do is figure out how to get the Army to give me a raise... lol!

  • Anonymous
    April 01, 2008
    Hi Jason, That is great to hear - congratulations! Scott

  • Anonymous
    April 04, 2008
    Great article, thank you! I was able to get the Contact Selector working perfectly by following these steps. My problem is that I got the CS control working fine on the first form. I tried applying it to another (blank) form and got the "Search Failed" error when I click the "Go" button (this is after I've published to the SharePoint forms library). The control only works for the form where I first established it. The CS control is now available in the list of controls on my InfoPath client but fail when implemented (even when I set up the same data connection and Context.xml file as the first form). I'm not trying to tempate the control, just use it on a completly different form. Any ideas? I tried to read through all of the comments first, but I apologize if this question has already been asked. Thanks. cg

  • Anonymous
    April 04, 2008
    Hi cgarcia, The first thing I would check is your data source in the new form. Make sure the structure is correct and the node names EXACTLY match what I have in this post...including capitalization. Scott

  • Anonymous
    April 16, 2008
    トピック、バラバラ(?)ですみません。 ブログのツールのエラーで、なかなかアップできなくて、情報提供に少し焦っています。 なので、InfoPath ネタという訳ではないのですが。。。 &#160; でも、InfoPath

  • Anonymous
    April 28, 2008
    Hi there, I have followed these steps to add the activeX control to my form, however whenever I try to resolve a name (either via searching or using the check name button), the whole control gets greyed out. When I use the search option, the search dialog does return a list of names as you'd expect but when I add a name and click OK, it gets greyed out. Do you have any idea what is causing this and how I can fix it. Regards - Martin Kearn

  • Anonymous
    April 29, 2008
    Hi Martin, Please verify the following:

  • The data source is designed exactly as I have in this post
  • The capitalization of the node names is exactly as I have in this post Scott
  • Anonymous
    May 06, 2008
    Thanks for the great article and all explanations after it. I have a problem with this control: after a task is completed, if you open the task to review what was done, the information entered on contact selector fields (one or many) is lost. Is there a simple way to get it back and display it?

  • Anonymous
    May 06, 2008
    Hi jagra, Some questions: does it retain the selected user(s) if you follow what is in this sample? If so (as it does for me) then how have you implemented the control? Scott

  • Anonymous
    May 27, 2008
    Hi Scott. This blog has been very helpful.  By reviewing the information here I been able to add the Contact Selector control to my form, and also set up a second instance of the control on the form.  All is working great! Now I would like to filter / restrict the selections to AccountType=User.  Right now it is possible to select security groups and distribution lists, either by browsing from the finder or by typing it in directly.  I want to prevent that and display some type of appropriate message to the users. I'm not a programmer, so my ability to get too custom with code is somewhat limited.  However, any thoughts or suggestions you might have would be greatly appreciated. Thanks, FourthMusketeer

  • Anonymous
    May 27, 2008
    Scott, I forgot to mention that I am using the browser to render the form, not the InfoPath client. 4th

  • Anonymous
    May 28, 2008
    Hi FourthMusketeer, I have been trying to develop sample code for this (there is no way to do this via the control, UI, etc.) but unfortunately I have not been successful in getting this to work. If I ever find a solution, I will be sure to post it here. Scott

  • Anonymous
    May 29, 2008
    Hi Scott, I am getting search failed error when I serach for a contact in Contact selector. User or person field works in my sharepoint site. I followed all the steps. I rechecked Spellings and Captilization. Should I publish the form to sharepoint for the contact selector to work. Any help is appreciated... Thanks

  • Anonymous
    May 30, 2008
    Hi k_luckyreddy, You should not have to publish the form template (XSN) for the Contact Selector control to work; however, for troubleshooting purposes this may be a good test. If the Contact Selector control still fails when being opened in the browser, check the server Application Event log and see if any errors around this issue are being written to the log. Scott

  • Anonymous
    May 31, 2008
    Q:为什么InfoPathForm作为TaskForm的时候,可以通过SPWorkflowTaskProperty.ExtendedProperties属性(一个哈希表)直接获得InfoPath...

  • Anonymous
    June 02, 2008
    Greetings, Refering to a post on May 6, the contact picker shows only the first choice when someone opens the form after the first submit (on workflow task history). That is done by defining the default value = ItemMetadata/ows_accountId. When more then one person ou group is selected, the data is correctly sent to workflow but opening infopath form only shows the first user. Maybe we are doing something wrong :( Can you post an example of an ItemMetadata that works for multiple values in a ContactPicker?

  • Anonymous
    June 10, 2008
    Hi jagra, I am not sure I follow - can you successfully show multiple values (separate by a semi-colon) if you just open an InfoPath form with the Contact Selector control? Workflow issues are handled by a different team so I am not sure how you are getting this information to the Contact Selector control but as a test, I can successfully open an InfoPath form with the Contact Selector control, enter 2 names (again, separated by a semi-colcon), resolve those names and save it in the underlying XML. So maybe the question would be: is the InfoPath form being "saved"? If not, I am assuming you are reading the values from the ItemMetaData? If so, how is this being done? Scott

  • Anonymous
    June 12, 2008
    The comment has been removed

  • Anonymous
    June 16, 2008
    Hi Andy, As you have probably seen, the user's "e-mail" address is not one of the pieces of data that is returned by the Contact Selector control. However, you can achieve what you want using a couple of string manipulation functions: "concat" and "substring-after". Here are the sample steps:

  • Modify your e-mail submit connection
  • Click the "fx" button next to the "To" field
  • Basically what you need is the user id after the "" from the AccountId field. So to get this you would use the "substring-after" function.     - Click Insert Function     - Select the Text category     - Double-click "substring-after"     - Double-click the first argument to this function and select the "AccountId" node for the Contact Selector and click OK     - Select the second argument to this function and replace it with this: ""
  • At this point, you should have this: substring-after(AccountId, "") What you need to do now is simply use the "concat" function to concatenate this with your e-mail domain     - Place your cursor at the front of the current expression and enter this: concat(     - Place your cursor at the very end of your expression and add this: , "@yourdomain.com")
  • Now your complete expression would look like this: concat(substring-after(AccountId, ""), "@yourdomain.com") (NOTE: You will need to replace "yourdomain.com" with the appropriate e-mail domain for you.)
  • Click OK to get you back to the Data Connection Wizard I hope this helps! Scott
  • Anonymous
    June 19, 2008
    Hi Scott, With reference to the post dated "10-Apr-2007" (regarding restricting Contact Selector control for user to select only 1 user), I have implemented the code given there but for the 1st time when i enter more than 1 user, the control gives the error (by marking the control RED). But when I remove all the users except 1, the control still persists with there error message. But when I remove all the users & then enter a single user, it works fine. Is there any modification that I need to make in that code? Regards, Vipul Mehta

  • Anonymous
    June 23, 2008
    Hi Vipul, After you remove the users, you need to validate the control again (i.e. click the Check Names button.) Just removing the additional names from the control itself does not actually remove them from the "Person" repeating node. To see this, temporarily drag the "Person" repeating node to your View as a Repeating Section with controls. Add your names and verify - result: you will see the added repeating sections. Now, just remove the additional names from the control - result: the repeating sections with those users are still there until you validate the names again. Scott

  • Anonymous
    August 05, 2008
    Hello, I'm encountering an issue when in the same form view I have the contact selector as well as a currency field with data format 'euro Dutch (Belgium)'. When I fill in my currency field, I get the american format (10,000.50) instead of the desired Dutch Belgium format (10.000,50). When I refresh the form or change view and return back, the format is updated to the Dutch one. Does anyone know how to edit the locale for the contact selector control or any other workaround? I'v already set the locale to Dutch in the site's regional settings, the form language and the currency field. Thank you in advance. Yannis-C

  • Anonymous
    August 07, 2008
    Scott, I wondering how come no one had asked this question so far on the 'siteUrl' in the Context.xml? I have an InfoPath form designed to be used from InfoPath client. I've designed this form in a development environment. So the Context.xml contains the URL for development site collection. Now I'd like to package the InfoPath form to be deployed in multiple Farms (Staging, Testing, Production). I've Data Connection library to take care of all other secondary connections. For Context.xml, I coould not create a I would like deduce the 'siteUrl' in the Context.xml on the fly based on the site collection to which it is being deployed. Is there way to do it. Thanks, Subbu

  • Anonymous
    August 07, 2008
    Hi Subbu, The only way I know of to do this would be to write code on the Loading event of the XSN that updates this value in that XML Resource File. Keep in mind, dynamic updates to Resource files do not persist once the form is closed so this code would need to run each time the form is opened.  Which of course means you would need to know this URL when you deploy those XSN files. Scott

  • Anonymous
    August 10, 2008
    Here is a solution if you want to limit the list of names to a group of people and only allow one selection.  This has limited uses but if you just need the email of a person so you can send email to them from a sharepoint workflow this does it. First dump contact selector, use drop down list instead.  This makes it easy to limit to a single person.

  1. Create a sharepoint custom list, add 2 columns  for the persons.  First one a name(with presence) the second set the Show Field to Work Email.  Fill in person for the name and email.  Most of the time where you are limiting the list of people some office is doing it and a simple note reminds them to duplicate the information; or have a workflow do it.
  2. Create a data connection using the retreive info from list.  Make sure to select the two columns you created.
  3. Create a drop down list and link the new data source to it showing the name and the value as your email address.  
  4. Publish and make available the column. You can now use that column in sharepoint workflow as an email address.
  • Anonymous
    August 10, 2008
    Here is a solution if you want to limit the list of names to a group of people and only allow one selection.  This has limited uses but if you just need the email of a person so you can send email to them from a sharepoint workflow this does it. First dump contact selector, use drop down list instead.  This makes it easy to limit to a single person.
  1. Create a sharepoint custom list, add 2 columns  for the persons.  First one a name(with presence) the second set the Show Field to Work Email.  Fill in person for the name and email.  Most of the time where you are limiting the list of people some office is doing it and a simple note reminds them to duplicate the information; or have a workflow do it.
  2. Create a data connection using the retreive info from list.  Make sure to select the two columns you created.
  3. Create a drop down list and link the new data source to it showing the name and the value as your email address.  
  4. Publish and make available the column. You can now use that column in a sharepoint workflow as an email address.
  • Anonymous
    August 15, 2008
    Hi Scott, Very informative article! Thanks for sharing. What you outlined works great, when I tried. My requirement is to be able to select email id in the submit form, just like having the contact selector once the form is submitted. The idea is to allow the applicant to direct the form to the appropriate approver. Is there a way to do this? Thanks FK

  • Anonymous
    August 18, 2008
    Hi FK, As you have probably seen, the user's e-mail address is not one of the pieces of information returned by the Contact Selector control. You can either use the UserProfileService.asmx web service (if you have profiles setup in your  database) or take a look at my reply on 6/16 on how you can do this by parsing the information returned by the Contact Selector control. Scott

  • Anonymous
    August 19, 2008
    Scott Thanks for your reply. But I am not able to use contact selector control itself in the submission part of the form. To let you know, I am fairly new to Infopath and may be contact selector is not the answer to my problem. What I am trying to do is allow the user to select to whom the form must be submitted(via email). And I was trying to use the contact selector to select the email id in submission, but with fail. Is there any other way to do this? Thanks FK

  • Anonymous
    August 19, 2008
    Hi FK, Here is what I am referring to:

  • I am assuming you have a Contact Selector control on your form template
  • As you have seen, this does not return the e-mail address of the user (there is no way to get that specific piece of informtion from the contact selector control.) However, once you select a user, one of the nodes that does get populated is the AccoundId node from the Contact Selector control. You can parse the information in this node to create the e-mail address...assuming you know the domain where the mail needs to go (i.e. fk@somemail.com) Scott
  • Anonymous
    August 20, 2008
    Got you . Works great now. Thanks for your quick response!

  • Anonymous
    August 21, 2008
    Hi, i have tried to create  the Contact Selector Control but when i load the infopath form in IE it doesnt do anything ? I must be doing something wrong somewhere. can you help me ??? Thanks JJ

  • Anonymous
    August 21, 2008
    Hi Scott, Please see below some more detail (same problem as someone else) I have checked the logs but no joy ? I am getting search failed error when I serach for a contact in Contact selector. User or person field works in my sharepoint site. I followed all the steps. I rechecked Spellings and Captilization. The only thng I can think of is that the server name is incorrect (i tried the SP server and the domain controller ) <Context siteUrl="http://<servername>"/> **NOTE: Replace <servername> with the name of your server Any help is appreciated...

  • Anonymous
    August 22, 2008
    Hi jj, The server that you enter in the context file should not really come into play if you are displaying the forms in the browser. I am wondering if there is some type of permissions issue possibly occurring? I would suggest you start with a Netmon trace and see if this shows where it is failing. If not - you will probably need to open a support case so we can dig into this further for you. Here is the download site for Netmon: http://www.microsoft.com/downloads/details.aspx?FamilyID=18b1d59d-f4d8-4213-8d17-2f6dde7d7aac&DisplayLang=en Scott

  • Anonymous
    August 24, 2008
    The comment has been removed

  • Anonymous
    August 25, 2008
    Hi Vipul, Can you see if the same behavior occurs with the SharePoint People Picker control? To test this, navigate in SharePoint to a Permissions page where you can add a user or group. When you enter a user's name or a group (as you are trying to do) this is using the People Picker control - does the same behavior occur here? Thanks, Scott

  • Anonymous
    August 25, 2008
    Hi Scott, I am having some issues with "Contact Selector Control" on multiple Infopath forms. I am using Infopath forms along with SharePoint workflow process. I have two Infopath forms; in the first form known as InitForm I added two "Contact Selector Controls" in which workflow-initiator will specify two participants for the workflow in the begining. In the second form known as RevForm, I added another two "Contact Selector Controls" in which workflow task-owner will specify two more task-owners on the fly. The second form will work as a modification form for the workflow. Now, the problem started with "Person" object when I converted both the forms into C# classes using xsd. I had to convert them into C# classes so that I could access them in the run time (I am using XML serialization/deserialization in the run time). Both the classes are in the same assembly, the compiler didn't like "Person" object twice. I tried with different name for "Person" in one of the Infopath forms. Somehow "Contact Selector Control" did not like any other name for "Person" object. What is the best approach in order to use Contact Selector Control on multiple forms? How can I access the data in the run time? I really appreciate if you could provide some advice in this regard.     thanks amit

  • Anonymous
    August 25, 2008
    The comment has been removed

  • Anonymous
    August 26, 2008
    Hi Vipul, If the SharePoint People Picker behaves the same way then this is not an issue with the Contact Selector control per sé and you would be best served to either post this query in a SharePoint blog or possibly even open a support incident with the SharePoint group to investigate this behavior. I am not a SharePoint expert so I won't begin to guess <g> if this is expected or not, can it be changed, etc. Amit - I have never tried converting to C# classes with multiple Contact Selector controls on one form - this may not be possible but I am not sure without further investigation. If you need this researched soon you would probably be best served to open a support incident to look into this further as I am not sure when I could do this. However, in the interim you may also want to post a query to a workflow blog to see if there is a way to get to the data without having to convert to C# classes. Scott

  • Anonymous
    September 05, 2008
    Hello Scott, I’ve posted a month ago an issue I had in relation with the Contact Selector control which unfortunately I haven’t solved yet. So first of all accept my apologies for bothering you again with this. I’ll describe my problem a bit more accurately.

  1. I have a web-enabled form with a currency field.
  2. This currency field is of Data type: ‘Decimal (double)’, Format: ‘Currency’, ‘Dutch (Belgium)’ and with ‘Use a digit grouping symbol (.)’ checked.
  3. When opening the form in a browser, the field works fine.
  4. When adding the Contact Selector control to the form, things go bad, meaning that if I paste the following number ‘100.000.000,99’ in the field, I get an error message ‘Only numbers allowed’. (The same error message occurs also when you manually enter a number and then change one digit.). This error happens only when opening the form in a web browser and with the control included the form. If you have any idea how I can prevent this happening, I would be very grateful. This control is much too nice not to make use of it for such a ‘silly’ issue. Thank you in advance. Yannis Chaviaras
  • Anonymous
    September 08, 2008
    Hi Yannis, It seems I can reproduce this without even having the Contact Selector control on the form template. At any rate, we need to look into this further and see if this is a potential issue. Please open a support case with Microsoft so we can dig into this properly and work with the Product Group on this should it be necessary. Thanks, Scott

  • Anonymous
    September 09, 2008
    Hi Scott, Thanks for you reply. A support case shall be opened asap. Regards, Yannis

  • Anonymous
    September 10, 2008
    Hi Scott, great blog. Just wondered if you knew of a way to apply validation to contact selectors on a browser only form? I have 3 CSs on my form and I want to ensure the user has entered people in each CS. So far all my playing about with the conditional formating has failed. Is there another way to achieve this? Many thanks

  • Anonymous
    September 11, 2008
    Hi rishiej, Thanks! It is a bit challenging to "validate" whether or not a Contact Selector control has a value and here is why: the corresponding "Person" node does not get updated until you "validate" the name selected or entered in the control.  You can easily see this by adding the Person node as a Repeating Section with Controls and then enter a name in the Contact Selector...none of the nodes under Person get updated until you validate the user. And the reverse is also true - if you simply delete the name you entered, the Person node does not get removed until you "re-query" (validate) what you entered. So this makes creating a fool proof validation method difficult if not impossible. Now, with that said, if you can "train" your users to always validate (click the Check Names button) their changes, then something like this will work: Add 3 new nodes (datat type = Boolean) to the "myFields" node: cs1Completed cs2Completed cs3Completed Add Conditional Formatting (I am assuming to, say, a button - that was my test) that simply check if cs1Completed is equal to False or cs2Completed is equal to False or cs3Completed is equal to False then disable the button. Now, you will need to code to toggle those "csxCompleted" nodes. To do this you will add the "Changed" event to each Contact Selector group (not the Person node but the parent group for each Person node.) In each changed event, I have code like this: if (e.Operation == XmlOperation.Insert || e.Operation == XmlOperation.ValueChange) {     SetBooleanNode(e.Site, "cs1Completed"); } And this is my SetBooleanNode procedure: private void SetBooleanNode(XPathNavigator xnCS, string strNodeName) {     XmlNamespaceManager ns = this.NamespaceManager;     XPathNavigator xnDoc = this.MainDataSource.CreateNavigator();     XPathNavigator xnBoolean = xnDoc.SelectSingleNode("/my:myFields/my:" + strNodeName, ns);     if (xnCS.SelectChildren(XPathNodeType.Element).Count == 0 || xnCS.SelectSingleNode("my:Person/my:AccountId", ns).Value == string.Empty)          xnBoolean.SetValue("false");     else          xnBoolean.SetValue("true"); } The reason we need to check the node count is if the user clears their entry and then clicks the Check Name button (which we want them to do <G>) then the entire Person node is removed. In my testing this appears to provide what you need; however, this is entirely contingent upon the user validating the name they entered or selected...even if the value is blank. I hope this helps! Scott

  • Anonymous
    September 11, 2008
    Thanks Scott, works a treat (not fool proof but certainly the best way) thanks again

  • Anonymous
    September 14, 2008
    Hi Scott, I've just tried to print an infopath form with the contact selector control on it. But the contact selector doesn't print. Any suggestions?

  • Anonymous
    September 14, 2008
    The comment has been removed

  • Anonymous
    September 22, 2008
    Using the Contact Selector Control

  • Anonymous
    September 23, 2008
    Hello Scott, I am having some problems about Contact Selector control. We have a MOSS Forms Library and on our form we would like for the person to be able to select whom to e-mail this form to. So, we have created the Contact Selector as described above.  Then we added a data connection to e-mail those people selected in the Contact Selector. The problem we are seeing is that when we select multiple users, how can we get  emails form AD for those users? In our AD, user account ID has no relationship with user's email address,  For example, we select two users (John Smith and Tom Smith) John Smith'e email is: johnd@hotmail.com and Tom Smith email is tomsmith@gmail.com. Any Thoughts? Thanks for all the useful information, Simon Liu

  • Anonymous
    September 23, 2008
    Hello Scott, I am having some problems about Contact Selector control. We have a MOSS Forms Library and on our form we would like for the person to be able to select whom to e-mail this form to. So, we have created the Contact Selector as described above.  Then we added a data connection to e-mail those people selected in the Contact Selector. The problem we are seeing is that when we select multiple users, how can we get  emails form AD for those users? In our AD, user account ID has no relationship with user's email address,  For example, we select two users (John Smith and Tom Smith) John Smith'e email is: johnd@hotmail.com and Tom Smith email is tomsmith@gmail.com. Any Thoughts? Thanks for all the useful information, Simon Liu

  • Anonymous
    September 30, 2008
    Hello Scott, This post has been quiet helpful in implementing the CS control in my forms, then with using multiple controls on forms, etc. One question which I have yet to get a definitive answer to is whether there is a way to promote the CS field from a form to a person or group column in MOSS. I can promote as simple text, but I would like to do it so there we have presence and a hyperlink (ideally without code). Is there just no way of doing this? Thanks, Sebastian

  • Anonymous
    September 30, 2008
    Hi Sebastian, The only way I know of is to use code because there is no mechanism to promote to a "Person/Group" field from within InfoPath. Scott

  • Anonymous
    September 30, 2008
    Hi Scott! Great article! I'm newby in IP, so, I've a problem ( I've got an SP workflow and my Instantiation form with Contact Selector Control. I need to assigne task to the user selected from the contact selector.  But I don't know how to do it. What value I should whrite in "taskProperties.AssignedTo"? I know there are 2 ways: 1. Use x-paths, 2. Convert form to C# classes using xsd.  But I still don't know what value(DisplayName/AccountID/AccountType) i should use to assign task correctly. I need help. Thanks for all pieces of advice Nick

  • Anonymous
    September 30, 2008
    The comment has been removed

  • Anonymous
    October 01, 2008
    Hi Scott! Thanks for your reply (esp for so soon)! Well, I found some, er, kind of solution of my problem , but... getting trouble whith Contact Selector Control. ( I'm starting to create a new workflow by myself (before this I changed existing one) and when I'm trying to open the form I have "unknow error" message. It seems to me that I missed something important... Well, I think, I should reread your great blog more cearfully. Thanks again Nick

  • Anonymous
    October 01, 2008
    Hi Nick, No problem - what I would suggest though in your new workflow test is to take the Contact Selector control out of the picture. Create the workflow without this control and make sure you can launch the form. Scott

  • Anonymous
    October 01, 2008
    How do I add two contact selector controls to the same form? I tried adding a second one but when I create the data for it mainly the groups and fields, it says the name of the group already exists. So I cannot name the group Person again or have fields named DisplayName.... Is this possible to do? Thanks

  • Anonymous
    October 01, 2008
    Hi Brad, Take a look at the May 22nd comment...this provides the steps. Scott

  • Anonymous
    October 01, 2008
    The comment has been removed

  • Anonymous
    October 02, 2008
    I just figured out a way to promote to a person or group field.  It only supports single values, but it will work.  Simply create to columns one text, the other a person or group.  Promote the "AccountId" to the text column, then with a simple SharePoint Designer workflow update the value in the person or group column to equal the value in the text column.   Sebastian

  • Anonymous
    October 02, 2008
    Hi Scott! Thanks! Well... Whithout Contact Selector my workflow works like a charm. So, now I'm trying to deploy a solution whithout this, using advice about mails and data sourses from your blog (thanks that guy how shared it, too). But it is temporary decision and I guess I'll return to Contact Selector later ( . It is not scary for me to use code and in your reply about "SharePoint ID" I see a way. Thanks again, Nick

  • Anonymous
    October 03, 2008
    BlueChan, Unfortunately I don't know of any way to accomplish this - sorry. Nick - glad to hear you are making progress...so the question now would be: since you have a working workflow, what happens if you add the Contact Selector control? If it then produces an error, turn on Verbose Logging (Central Admin | Operations | Diagnostic Logging) for the various Forms Services categories and see if anything is logged that would provide additional details as to what is failing. Scott

  • Anonymous
    October 06, 2008
    The comment has been removed

  • Anonymous
    October 07, 2008
    The comment has been removed

  • Anonymous
    October 07, 2008
    Scott, I did exactly what you suggested on #1 by creating a new, blank form that has nothing except the steps in this blog entry, and I get the exact same errors.  I already have my diagnostic logging turned on but may not have it set to verbose, so I'll go check.

  • Anonymous
    October 07, 2008
    Don't see any errors in the trace log, but I also notice that my Diagnostic Logging settings keep reverting back to null.  Is that normal?  I set to All/-/Verbose, hit OK, it takes me back to the Operations page, then I click on Diagnostic Logging, and all the pulldowns are set back to null.

  • Anonymous
    October 07, 2008
    Sorry for the multiple posts, but I have a set of screenshots showing:

  1. The strange browser error when trying to open a new browser-enabled form with the Contact Selector (rest of form is blank)
  2. Design mode of the form that confirms the spelling and setup of the data elements - shows the items tab on the properties of the Contact Selector control
  3. Shot showing the form in Preview mode (rich client) and how the To: button works and can retrieve my name from AD
  4. Shot showing the form in Preview mode after selecting my name and hitting OK How can I post this?  I have them as 4 images in a zip file that is less than a Meg.
  • Anonymous
    October 07, 2008
    The comment has been removed

  • Anonymous
    October 07, 2008
    Yeah, my people pickers work everywhere, so that doesn't seem to be a problem, but I have new info that should really lead me to a solution, but it hasn't yet. I had a friend at MS send me a working form that already has this same Contact Selector added, and when I use his form, the Contact Selector works perfectly both in rich-client and browser form.  I just had to change the resource file and a few other things, but when I published it to the SAME library as my previous form, it rendered in the browser perfectly like you would expect.  I have been viewing each form side-by-side and cannot see any anomalies except that his form had the data elements inside the Person group set to "repeating," but yours aren't repeating in this blog.  I changed mine to match, but the behavior didn't change, so I don't believe that's an issue.

  • Anonymous
    October 09, 2008
    Hi ClaytonCobb, That is indeed interesting information. If you would, navigate to: C:Program FilesMicrosoft OfficeOffice12, right-click on the "ContactPicker.dll" file and choose Properties - what is the Size, Version and Date Modified properties on your file? Scott

  • Anonymous
    October 16, 2008
    Hi Scott,    I have been trying to get the Contact Selector to work for 2 days now but it still would not work. I followed your steps exactly and repeatedly doing it to make sure I did not make any mistakes. However, when I tested my form, it always showed search failed. I am wondering that it may have to do with the server that URL that I used because I'm unsure of it. http://servername/_vti_bin/UserProfileService.asmx. Thank you cewe

  • Anonymous
    October 17, 2008
    The comment has been removed

  • Anonymous
    October 17, 2008
    Hi Scott,    Yes, it works. Why do you want me to test this? Is it to test if the sharepoint's directory is working? Thanks cewe

  • Anonymous
    October 17, 2008
    Hi cewe, Many times when I have seen the Contact Selector control display Search Failed that you will get the same error when using the People Picker control in SharePoint - so I wanted to see if this was isolated to the Contact Selector control or happened elsewhere as well. What is the exact URL you used to publish the XSN? Scott

  • Anonymous
    October 19, 2008
    Hi Scott Thanks for a great post and very helpful comments. I am using a contact selector in an Infopath form which will retrieve a users contact details when they enter their name. We do not store these details in AD, so this is a web service look up to another database. I have entered some rules which are set in the data source on the group containing the Person repeating group. These rules take the accountID from the contact selector and pass them into a query in the web service. It then populates several fields with the results of the query. This works perfectly in Preview mode but does not work when the form is published to SharePoint  Forms Services. It appears that when you enter a name and click the check button - the rules fire immediately - that is, before the name has been validated against AD and therefore before the AccountID is known. Any ideas on how I can get these rules to fire only when the name has been vaildated? Many thanks

  • Anonymous
    October 21, 2008
    The comment has been removed

  • Anonymous
    October 21, 2008
    Thanks Scott I was thinking code but that didn't seem as straightforward as I'd hoped. (http://www.infopathdev.com/forums/t/8156.aspx was helpful although they seem to be using a changed event rather than validating) I have managed to get my rules firing correctly when they were placed on the AccountID data source. I had tried this about 6 wks ago - but the rules didn't fire in InfoPath preview so I never imagined they would fire in the browser!! Obviously the contact selector behaves quite differently depending on whether you are using it in the native InfoPath or publishing to the web. Mel

  • Anonymous
    October 21, 2008
    I have used SharePoint Designer in creating this workflow. I have used one infopath form and publised it to a SharePoint Library so that after filling it, users can submit. In this form , i have used a contact selector control named "Participants" so that user can write the name of participants. I want mail should go to each and every participant (Whose names user write in Contact Selector Control). Well contact selector does have the functionality of sending the mails by reading the user's names and email addresses from active directory but it is sending only to the first person (among the names which i write in that control). While publishing the form when we map Infopath fields to sharePoint library, there come some options when i click on "AccountId", options are "first", "last", "count", "merge". When i click on first and publish the form then it sends mail only to the person whose name appears first on the contact selector control. If i selecet "last" then it sends mail only to the person whose name appears last on the contact selector control. On count it gives a integer value specifying the number of users in that control. When i use merge then it just merge all the names but does not send mail. I am not getting how to send mails to all the participants. Its really very urgent. Plz help Regards Ginni

  • Anonymous
    October 22, 2008
    The comment has been removed

  • Anonymous
    October 22, 2008
    Hi Scott,    Here is my exact XSN: http://<servername>/test/Infopath Forms/Forms/template.xsn Thank you cewe

  • Anonymous
    October 23, 2008
    Hi cewe, OK - I may have missed something in your previous post: where are you adding this URL: http://servername/_vti_bin/UserProfileService.asmx ? Also - where are you seeing Search Failed? Is this when you click the "To" button and search for a name? Are you opening the form in the InfoPath client or in the browser? It sounds like you entered that URL in the "Context.xml" file - if this is the case, then you need to modify that URL to either: http://servername or http://servername/site (if "test" is indeed a subsite.) Scott

  • Anonymous
    October 30, 2008
    Thanks a lot Scott. Its working now but one issue is there. That above infopath code is assigning one extra task. I mean if i am entring names of 4 participants then on start of workflow, in workflow details, it shows the task assgined to respective users like : AAA            Collecting Data BBB            Collecting Data CCC           Collecting Data DDD           Collecting Data                  Collecting Data But it is assigning one extra task, without any name. I am not getting from where this extra task is comig where namefield is blank.(AAA, BBB are just names of participants) Regards Ginni

  • Anonymous
    October 31, 2008
    Hi Ginni, I am not sure what code you are referring to? If this was specifically workflow code, you may need to post this issue in a workflow blog. Scott

  • Anonymous
    October 31, 2008
    The comment has been removed

  • Anonymous
    November 05, 2008
    Hi Ginni, I don't see how just adding that expression to a control would cause an additional (blank) task to be created. Do you have any code that creates those tasks? If so - how is that being accomplished? Is it looking at the names in this textbox to determine how many tasks to create? Scott

  • Anonymous
    November 05, 2008
    The comment has been removed

  • Anonymous
    November 05, 2008
    Hi Scott I want to ask one more think. Is there a way of resolving the names in the contact selector control by just hitting the enter key rather than pressing the check names button? Ginni

  • Anonymous
    November 05, 2008
    Sorry its not think, its thing

  • Anonymous
    November 06, 2008
    Hi Ginni, I am not sure why SharePoint Designer would be adding an additional blank row like that - I wonder if it is because it interprets the trailing ";" as a new entry? If you want, try changing the expression that concatenates the values to this (this is still based on the sample here so field names, paths, etc. would still need to be verified): substring(xdMath:Eval(xdMath:Eval(../my:attendees/my:attendee, 'concat(my:attendeeEmail, ";")'), ".."), 1, string-length(xdMath:Eval(xdMath:Eval(../my:attendees/my:attendee, 'concat(my:attendeeEmail, ";")'), "..")) - 1) All this really does is remove the trailing ";" from the concatenated list of values. In regard to the Contact Selector question, the only way to validate a name is to:

  • Click the "Check Names" button
  • Tab to the "Check Names" button after entering a name and then you can use the Space bar
  • Use the "To" button where the Enter key will work to perform the search and the selection. Scott
  • Anonymous
    November 06, 2008
    Thanks a ton Scott. Its working great. I am very grateful to you.

  • Anonymous
    November 07, 2008
    Excellent! I am glad to hear it works as you need Ginni... Take care, Scott

  • Anonymous
    November 10, 2008
    Scott, In reference to our exchange back on Oct 9th, I have the information you requested regarding the properties of my ContactSelector.dll: Size: 187 KB Version: 12.0.6211.1000 Date Modified: 8/24/2007 2:36 AM I'm still baffled as to how a form that someone sent me works fine (after tweaking the settings to match my environment), yet no form I create myself following the instructions will work.  You would think that through deductive reasoning, I'd be able to find the missing link or errant variable, but I see no differences at all.

  • Anonymous
    November 10, 2008
    Scott, Disregard it all.  Using the working form and my non-working forms, I slowly ate away at the differences and kept breaking the good form one piece at a time until I narrowed it down to the final variable, and it truly was just the thing you told me to do at the beginning. No matter how many times I looked at the syntax of the XML fields, I never noticed that the "d" in "AccountId" was capitalized in my forms but not in your write-up (nor in the good form).  I guess the capital "I" kept throwing me off into thinking the "d" was also capitalized, but oh well.  The moment I changed that one character, it all started working.  I am now making some nice workflows using this (using the AccountID element) and will be changing many of my other nice forms to use this feature instead of having to use custom contact lists with drop-downs. Thanks for all the help.  Now, I wish I could delete all the previous posts except the first one!  =P

  • Anonymous
    November 10, 2008
    Hi ClaytonCobb, I am very glad to hear everything is working now! (It's always the little things...isn't it? <g>) Take care, Scott

  • Anonymous
    November 16, 2008
    Hi Scott I have spent a great deal of time reading though this Blog and its replies(which I must say has be overwhelmingly helpful). But I’m having a few little issue I’m hoping its a easy fix or at least you can point me in the right direction. I have a Browser enabled InfoPath form with the contact selector working on it. This form submits to a list in SharePoint site but its unable to properly receive the data from the contact selector as it needs a format of 1#;JohnSmith or 32#;JaneSmith for it to be submitted to a list. I can concat  the info I receive from the Contact selector so i can submit to the list. But I don’t know how to get the ID to submit to the site Or is there a easer way to submit to the list and I’m going about this all wrong.

  • Anonymous
    November 17, 2008
    Hi cheshirefury, If you are just submitting new records to a SharePoint list then you should not need the ID. Have you seen this post: http://blogs.msdn.com/infopath/archive/2007/03/26/submitting-to-a-sharepoint-list.aspx Now if you need to also edit/delete items from a SharePoint list you will need to use code and in the above post (you will need to review the comments) there is sample code to perform edits and deletes. Scott

  • Anonymous
    November 17, 2008
    Hi Scott, Really a great post and comments... But I have 2 questions: 1)What if i need this contact selector to connect to an active directory(not to the sharepoint active directory) what shall i do??is their any changes that i can do to the context file or even add a data connection to the data connection library??(in this case i will use a web service and put the url of that web service in the data connection library) 2)second what if i want it to display the email,and the email can't be formulated from the display name?? and can we display that mail instead of the displayname field?? I will be greatful if you answered my questions.

  • Anonymous
    November 18, 2008
    Hi NohaMohsen, There is not a way to change where the Contact Selector control queries its data so there are a couple of options:

  1. Write your own code behind InfoPath or in a web service to query Active Directory
  2. If you have Microsoft Office SharePoint Server (MOSS) you could look at using the "Profile Database" and you can pull information from your AD into the profile database. Now this would not change how you use the Contact Selector control but what you could do is use that control to find/make a selection and then pass that user account to the "User Profile Service" (MOSS web service) to return information about that user...including their e-mail. In regard to displaying the e-mail - as you have seen this is not a property that is returned in the Contact Selector data. So you can use the Profile database as noted above or - if your e-mail addresses are consistent (i.e. user@yourdomain.com) then you can parse what is returned by the Contact Selector control and constuct the e-mail address. (For more information on this option, take a look at the June 16th response I provided.) Scott
  • Anonymous
    November 18, 2008
    Cheers Scott There is other reason im submitting via the code one of the reason's is that i am having a lot less issues and more control on the form doing it this way. ATM its looking as though i wont me able to avoid doing it the code way. Is there still a way to submit if i do it the "code" way.

  • Anonymous
    November 19, 2008
    Hi cheshirefury, I am not sure I follow your question: are you asking if there is a way to submit to a list via code? If so - then yes and just take a look at the prior post I mentioned. Scott

  • Anonymous
    November 19, 2008
    Hi scott, Thanks for the quick reply,and i did the email part... But regarding the AD part,how shall i implement that??I only have an event for the value changed and no other events....how can i handle the "Go button " present in the custom contact that does the search?? If you have a sample code for that ,that will be great. NohaMohsen

  • Anonymous
    November 19, 2008
    Sorry Scott for the confusion. Im only looking for a way to submit the data from the Contact Selector Control to a "assigned to" list column via code. I have looked though the coments on this page and http://blogs.msdn.com/infopath/archive/2007/03/26/submitting-to-a-sharepoint-list.aspx But im still missing what im after. I will check though the comments again and see if i can find it. Sorry for all the hassle it just i have been looking for a solution to this for a while now.

  • Anonymous
    November 20, 2008
    Hi NohaMohsen, If you want to use code to query Active Directory from the Contact Selector control, you can use the "Changed" event for the "Person" node. Here is some sample code: NOTE: You will need to add the following "using" statement (and reference if it is not already there) using System.DirectoryServices; public void Person_Changed(object sender, XmlEventArgs e)        {            if (e.Operation == XmlOperation.ValueChange || e.Operation == XmlOperation.Insert)            {                //Create a NamespaceManager object                XmlNamespaceManager ns = this.NamespaceManager;                //Create an XPathNavigator object for the main DOM                XPathNavigator docXN = this.MainDataSource.CreateNavigator();                //Create a string variable to store the selected users "AccountId"                string userName = docXN.SelectSingleNode("/my:myFields/my:gp1/my:Person/my:AccountId", ns).Value;                //For AD, using the "samaccountname" we just want the login name so parse that value                userName = userName.Substring(userName.IndexOf("&quot;) + 1);                //Create a new AD SearchResult object using a DirectorySearcher object and passing it                //the userName value                SearchResult result = new DirectorySearcher("(samaccountname=" + userName + ")").FindOne();                //Insure we found a user                if (result == null)                {                    MessageBox.Show("Error finding user: " + userName);                }                else                {                    try                    {                        //Create a new AD DirectoryEntry object using the GetDirectoryEntry method                        DirectoryEntry employee = result.GetDirectoryEntry();                        //Get the user's full name by calling the displayName property                        string FullName = employee.Properties["displayName"].Value.ToString();                        //The following returns the manager's name and additional AD info - so we will                        //parse this to get just the name                        string ManagerName = employee.Properties["manager"].Value.ToString().Substring(3, employee.Properties["manager"].Value.ToString().IndexOf(",") - 3);                        //Get the user's location                        string strLocation = employee.Properties["physicalDeliveryOfficeName"].Value.ToString();                        //Get the user's title                        string strTitle = employee.Properties["Title"].Value.ToString();                    }                    catch (Exception ex)                    {                        MessageBox.Show(ex.Message);                    }                }                result = null;            }        }

  • Anonymous
    November 20, 2008
    Hi cheshirefury, Ah - this helps...submitting to the "Assigned To" column is different. First of all, the name of the column is: AssignedTo and what you send to this column is the SharePoint "User ID", a numeric value. So when I, say, want to submit to the Tasks list (which has an Assigned To columnn) I submit a value of: 1 and this shows as: Scott Heim. So the key to this is you need to get the SharePoint User ID for the user selected in the Contact Selector control and then send that value to the Assigned To column. You can easily do this with a custom web service on your server that takes the site and selected user as parameters and then simply call: web.AllUsers[passedInUserName] - as this will return the User Id. Here is a sample web method: [WebMethod]    public int GetUserID(string strSite, string strDomainUser)    {        if (strDomainUser != "")        {            SPSite site = new SPSite(strSite);            SPWeb web = site.OpenWeb();            SPUser user = web.AllUsers[strDomainUser];            return user.ID;        }        return 0;    } Scott

  • Anonymous
    December 03, 2008
    You can easily get email at least for the predetermined amount of entries if you have access to the Sharepoint's UserProfileService.asmx without writing any code behind. For example for the first entry all what you need is to assign that field in an action: my:gpContactSelector/my:Person/my:AccountId[1] to the service parameter: /dfs:myFields/dfs:queryFields/s0:GetUserProfileByName/s0:AccountName in the next action you should call Query using data connection after that  you should have your email populated in the service structure

  • Anonymous
    December 09, 2008
    Hi, This is a great article. I am new to infopath. I have implemented this contact selector control and it is working properly in Infopath. I have published this in Sharepoint and is opened from there. Say my name is Ramanan, Abhishek(Lastname, FirstName), and I enter 'Rama' in the contact selector and click search I am gettin this error. 'There was a form postback error. (User: MEDIMMUNEVenkataramananA, Form Name: New Card Application Browser, IP: , Request: http://md1vm098/_layouts/Postback.FormServer.aspx, Form ID: urn:schemas-microsoft-com:office:infopath:New-Card-Application-Browser:-myXSD-2008-12-08T17-19-57, Type: SchemaValidationException, Exception Message: Schema validation found non-datatype errors.)' Please help ASAP.

  • Anonymous
    December 10, 2008
    Hi abhishekv, Here is where I would start to troubleshoot this:

  • Enable Verbose logging for the following categories:     - Feature Infrastructure     - Forms Services Data Objects     - Forms Services Runtime     - Forms Services Runtime - Data Connections
  • Reproduce the error and then check the latest SharePoint ULS log...hopefully this will point you to a more specific error indicating the problem. If you don't get any additional details in the logs then I would select the "All" category, set this to Verbose, repro the error and check the logs again. We should be seeing something in the ULS log that points you to the issue. Scott
  • Anonymous
    December 16, 2008
    Here is my blog where email problem is solved http://alecpojidaev.wordpress.com/

  • Anonymous
    December 29, 2008
    Hi Scott, Thanks for the great article. I am using contact selector in browser based InfoPath form. In the form there are three contact selector and they are optional based on business logic. By default I have assigned a value “NA” to the AccountID field. This defaulted value is also used in the associated workflows. Whenever this form is opened, there is a 7 to 20 second delay. When I went thru the SharePoint logs, I noticed a error message “Error in resolving user 'NA' : System.Runtime.InteropServices.COMException (0x8007203A): The server is not operational”. This message appears maximum three time and each one takes approximately 7 seconds (timeout). To eliminate this I have changed the form by setting AccountID field to blank. Now I do not get this timeout. My question is: [1] When a correct full name or account ID is entered, the control validates in no time. But whenever a wrong/partial user name is entered in the control for validation, the control takes 7 seconds to return back. Why this much of a delay? [2] Is this timeout set in SharePoint or AD? Any way to reduce this timeout? Thanks Prabhu

  • Anonymous
    January 05, 2009
    The comment has been removed

  • Anonymous
    January 11, 2009
    We are setting our contact selector from a workflow and when our browser form is opened, the selector shows strange information in front of the name like 16:#  Has anyone seen something like this?  Any ideas of how to fix that?  Thanks! hiszorn

  • Anonymous
    January 12, 2009
    The comment has been removed

  • Anonymous
    January 12, 2009
    Hi Scott, For some reason, this strange value changes to different numbers (16;# and 17;#) depending on the person the selector has been set to.  I will check to see if we can see that value in the workflow.  Strange one though... hiszorn

  • Anonymous
    January 28, 2009
    Hi SCott, Do you have any idea how can i call from the code the validate of the control....that is it validate what is entered in the field by calling the code.

  • Anonymous
    January 29, 2009
    The comment has been removed

  • Anonymous
    February 02, 2009
    InfoPath is a great tool that allows you to quickly design and implement browser-based electronic forms

  • Anonymous
    February 09, 2009
    Hi Scott, I've created a custom SharePoint workflow in VS2008. It uses InfoPath task forms to manage the approval process. When a workflow task task form is opened in Outlook 2007, the user can complete the form by clicking the "Edit this task..." button directly in Outlook. This is the first time I've had to add a contact selector control to a task form. The contact selector works correctly when you modify the task from within SharePoint. When I modify the task from within Outlook, the contact selector does not return any names and responds with "Search failed.". I created a Context.xml and set it as a 'receive' datasource as you recommended, to no avail. Have you any suggestions on this one?

  • fodi
  • Anonymous
    February 09, 2009
    Scott, I think I solved this issue. After trying to fix it for two days, I posted on the forum and fixed it an hour later... go figure. In the end, I used the full Context tag, as described on MSDN: <Context isStartWorkflow="false" isRunAtServer="true" provideAllFields="false" siteUrl="http://myServer.FQDN" /> I don't think that's what fixed it though. Golden rule: If you've got InfoPath installed locally it will cache forms. This also applies to forms that are opened within Outlook 2007. After making changes to these forms, make sure you run: Infopath /cache clearall Hope this helps someone else down the track.
  • fodi
  • Anonymous
    February 10, 2009
    Hi fodi, Thank you for the information - I am glad you were able to get this working! Scott

  • Anonymous
    February 27, 2009
    How do I reset an entry in the contact selector?  I have only one entry picked.  To reset, I set the DisplayName value to "".  It seems to work in Infopath but on the browser version via Sharepoint, the entry does not clear.   Will it require custom code? Ganesh Bala

  • Anonymous
    February 28, 2009
    I have two issues with my contact selector:

  1.  I have several contact selector's on a form. The form has a submit button that submits the form to email not as an attachment. The contact selectors always show up black, and I am unable to read the what the user entered into the form. I try to change the background color, and it appears as though it works, but then it reverts back to black as soon as I go back to the properties to see if my change persisted.
  2.  Infopath has been crashing on me consistently whenever I hit Print or Print Preview not from the template but from a filled out form, or a preview of the form. I have isolated the occurrence of the crash to only occur when a contact selector is on either my print view or even the normal view.   Any thoughts on what to do to resolve this crash and still use a contact selector? Or any other ideas? Not sure if these two are related or not, but it seems plausible.
  • Anonymous
    March 02, 2009
    Hi Ganesh, To clear the Contact Selector control in a browser form, there are two things you will need to do:
  1. Use a Rule to set all three fields for the Contact Selector to an empty string
  • Action: Set a field's value
  • Field: DisplayName
  • Value: <Just leave this blank> Do the above for all three fields
  1. Assuming you are using a button to clear the Contact Selector control, you will need to change the postback setting to "Always"
  • Right-click on the button and choose Properties
  • Select the Browser Forms tab
  • Change the Postback setting to Always Re-publish the XSN. Scott
  • Anonymous
    March 02, 2009
    Hi Birkland,
  • For question #1: are you saying that when the form is received in e-mail you cannot make out the text in the Contact Selector control or is it the entire form that is "black?"
  • For the crashing question, do you get the same behavior if you create a completely new XSN following the steps in this blog post? Scott
  • Anonymous
    March 02, 2009
    Hi Scott,
  • Just the contact selector is black.  You can see a screenshot at: http://picasaweb.google.com/lh/photo/z8Ljf9v_auhMjmlamQCQXQ?feat=directlink Also, I have checked the background color, and tried to change to another color, but after I hit ok, and go back to verify my change, the color is back to black again.
  • I have to give this a try ... more to come ... Thanks for your help! Birkland
  • Anonymous
    March 02, 2009
    Hi Scott, So I tested this with a new form, and it appears as though the form only crashes when I open an infopath form that has already been submitted to my document form library.  If I start any new form, fill in data, and hit print preview or print then it is fine. Phil

  • Anonymous
    March 03, 2009
    Hi Birkland, OK - I've done some testing on my side and I am not seeing the same behavior as you in regard to what you see in mail. I have tried with my submit connection set to both attaching the form and not attaching the form and in both cases, I actually see nothing in the Contact Selector control (in fact, I don't even see the Contact Selector control.) Now, this actually makes sense since this is an ActiveX control and the information being stored is in the DisplayName, AccountId and AccountType fields. So I am not sure why you are seeing black but even if you didn't, you will probably want to create an "e-mail" view where you don't have the Contact Selector control but simply the DisplayName or AccountId fields in its place. You would first switch to this view and then send your mail. (NOTE: You should be able to just copy/paste all the controls from your current view to a new view and then simply remove the Contact Selector control and replace it with one of the other fields.) In regard to InfoPath crashing when Print or Print View is used with the Contact Selector control - I found this is a known issue that our Product Group. Now again in my testing, I can successfully use: File | Print | Print Preview but if I just choose Print Preview from the File menu it fails. Scott

  • Anonymous
    March 03, 2009
    So if for the contact selector showing up black, if I have two submit actions.

  1. Submit to library 1.5 change view to print preview view, or would a print preview not work.  I thought I had tried this, and the entire form was white or blank, I couldn't see anything, but I did not try a regular view as opposed to a print view.  I'll give that a go around.
  2. Submit to email I will also test out just using the File Print Preview action as well. Thanks for your help.   Birkland
  • Anonymous
    March 03, 2009
    Hi Scott, Even File | Print | Print Preview throws exceptions on me everytime.  I also moved my other issue regarding changing views for emails to somewhere that seemed more appropriate on your blog at: http://blogs.msdn.com/infopath/archive/2007/01/17/emailing-a-custom-view.aspx?CommentPosted=true#commentmessage Birkalnd

  • Anonymous
    March 04, 2009
    Hi Birkland, I am not able to reproduce the crash on XP or Vista machines using File | Print and then clicking the Preview button. Keep in mind, I am testing using the same form as what is designed in this sample so there may be something else going on with your form template. I also have Service Pack 1 installed for Office - so if you can repro the crash using the same form as designed in this blog post and you have SP1 installed for Office 2007 then you will probably want to open a support case so an Engineer can dig into this more, capture traces, etc. to try and isolate the issue. Scott

  • Anonymous
    March 04, 2009
    I'm a little new to writing code and for some reason I can't get the control to work.  The search keeps failing.  I'm pretty sure it has something to do with the way I'm pointing to the server.  Here's what I'm putting. <Context siteUrl="http://doc1xxxxx103"/> Should I be using the site url where the form is published? <Context siteUrl="http://sitename/subsitename"/> Sherry

  • Anonymous
    March 04, 2009
    Hi Scott, I figured out what it was with the crash.  I had the view set to as a print view.  But then under View | Print Multiple Views settings, the non print view was selected as the one and only view to print.  I changed this to the print view, and duhh, things worked just fine. Thanks again, Birkland

  • Anonymous
    March 04, 2009
    Hi Scott, Your response to my question on "How do I reset an entry in the contact selector? "  was a life saver and it worked out great. Thank you Ganesh Bala

  • Anonymous
    March 05, 2009
    Birkland - nice find! Glad that the Print Preview is now working for you. :) Ganesh - I am happy to know the information helped! Sherry - The "Search failed" may or may not be related to the URL you are entering. That is certainly the first thing I would change and see if it makes any difference. If not, let me know and I will have some additional troubleshooting tests. Scott

  • Anonymous
    March 09, 2009
    I am still having issues with Printing the Contact Selector field. I have made a sepeerate printing view but still seem to not be able to print it... I'm somewhat of a novice at infopath so any replies please make them accordingly. Thanks for your help in advance... What I have done so far:

  1. Made seperate printing view first with display name, then with the other option listed above. Both did not work.
  2. jacked with the print multiple views option but that didn't work either.
  • Anonymous
    March 10, 2009
    The comment has been removed

  • Anonymous
    March 10, 2009
    Awesome! THanks! That worked, now I just need to tweak it to make it look good. Thanks a LOT. You dont know how much heartache you saved me.

  • Anonymous
    March 16, 2009
    Hi Scott, I have another question for you, the IT police at my organization are yelling at me, since the data or email recipients that are tied to sharepoint through this web service is not entirely accurate for reasons I do not understand quite yet.  One of the reasons for this is that the sharepoint directory of users contains members that have left the company, and are no longer active in the normal outlook exchange directory.  Also generic IDs are included in the sharepoint directory of users, and PDLs are not in sharepoint The recommendation to me was to search out other controls that would not use a sharepoint directory by tie more directly with the outlook directory, possibly through the control "Microsoft Office Outlook: recipient control" or something similar.   Are there other similar controls? Thanks, Birkland

  • Anonymous
    March 17, 2009
    The comment has been removed

  • Anonymous
    March 25, 2009
    Haha Scott I just wanted to mention I think it's funny how long this comment list has become. You are a champion for keeping up with all the different queries, ideas and responses. tips his hat

  • Anonymous
    March 25, 2009
    Thanks harbrich! :)

  • Anonymous
    March 27, 2009
    Great article but I have a question.... I have the contact selector working on the form, however every time I select an employee from AD and goto insert another item. The repeating region goes blank on my form. I have been searching the web for some examples of how this control is being used to examine what I may be doing wrong, but I am coming up empty. Does anyone have some suggestions that could aid me on this issue? Thanks, Doug

  • Anonymous
    March 27, 2009
    Hi Doug, I am not sure I understand the behavior you are describing. Do you have the Contact Selector control in a Repeating Section? Can you describe your setup more so I can get a better understanding of how your XSN is designed? Thanks, Scott

  • Anonymous
    March 27, 2009
    The comment has been removed

  • Anonymous
    March 30, 2009
    The comment has been removed

  • Anonymous
    March 30, 2009
    Scott, Ok I have try what you have instructed in a new form and in the one I am playing with. However now when I place a name in the contact selector and click the check mark I get no results and the contact selector gray's itself out... This is far better than everything disappearing like before I have re verified my case to make sure everything matches and I am using the same XML file as before so I know it was linking back the server correctly.. Any suggestions...

  • Anonymous
    March 30, 2009
    Let me rephrase whats going on because I have had some different results now. The new form still will not find anyone in the directory, which I believe is due to the fact its not prompting me for credentials to the SharePoint site. I did find an error on my part not putting the Person repeating group in the list however this still doesn't allow it to work. My original form I have been working with will now look up the contacts again, same issue forgot the Person group as well.  However after picking the person in the directory the control will gray out making it usable. The original form does ask for credentials when opening because I have it attached to some SharePoint Lists. FYI: Currently the way we are setup is not everyone is on a central domain and everyone has to access the site over http causing them to log on when things are accessed.

  • Anonymous
    March 30, 2009
    Hi Doug, The only time I have seen the "grayed out" behavior is when the Contact Selector nodes either not spelled correctly or the case of the names is incorrect. For instance, if I simply change: AccountId to AccountID, the form will open fine and the control will appear to work but as soon as I select a user, it becomes grayed out. So the first thing to check is the capitalization on all nodes specific to the Contact Select control (Person, DisplayName, AccountId and AccountType) have the correct capitalization. Scott

  • Anonymous
    March 30, 2009
    The comment has been removed

  • Anonymous
    March 30, 2009
    I will call this a dyslexic moment for me... The AccountId got me. I must have had it misspelled because the Id part was right. After retyping it everything work like a charm. Thank you for your help on this matter.

  • Anonymous
    March 30, 2009
    That's great to hear Doug! :)

  • Anonymous
    March 30, 2009
    The comment has been removed

  • Anonymous
    March 31, 2009
    Cuando diseñamos un formulario para ser utilizado en Infopath Forms Services debemos tener en cuenta

  • Anonymous
    April 16, 2009
    Some time ago now, I published a post entitled Quick Tip: Using the SharePoint ‘Person or Group’ field

  • Anonymous
    April 26, 2009
    The comment has been removed

  • Anonymous
    April 27, 2009
    The comment has been removed

  • Anonymous
    April 28, 2009
    I know what you’re thinking ….”Wooohooo … yet another article from Martin about InfoPath and the Contact

  • Anonymous
    April 30, 2009
    Hi scott, I am using contact selector control in a repeating table. Now i want that a mail should go to all, whose names i mention in contact selector control in each row. I am writing only single name in a contact selector control in each row. How can i do this?

  • Anonymous
    April 30, 2009
    The comment has been removed

  • Anonymous
    May 05, 2009
    I have an unusual scenario, my client wants an InfoPath for to select contact from the local Outlook contacts list. Is there a way to do this? Thanks Thomas

  • Anonymous
    May 05, 2009
    The comment has been removed

  • Anonymous
    May 14, 2009
    The comment has been removed

  • Anonymous
    May 14, 2009
    Scott, I really admire u for answering each and every doubt of everyone. Really, i appreciate u a lot for this. Scott, few months back u gave me the solution of sending mail through contact selector to several people. Now i have a doubt. If i select a group in Contact Selector, then it is sending mail to all the members of the group but i also want the users to see the members of that group. While sending mail and in infopath form, it only shows the name of the group but not the members. Now how should i extract the names from the group(which i entered in Contact Selector) in infopath form? Regards Ginni

  • Anonymous
    May 15, 2009
    Hi Ginni, The only information returned in the Contact Selector is simply the name of the group if its been validated. As such, you would need to use another call (i.e. to a web service) to get the users that are part of the group. There is a SharePoint "UserGroup" web service (usergroup.asmx) that can be used to enumerate the users in a specified group. In order to use this in InfoPath you will need to make some modifications to the XSD files that are created when you make the connection and the steps to use this web service are documented here: http://www.infopathdev.com/forums/t/11482.aspx Scott

  • Anonymous
    May 16, 2009
    Hi Scott, I read that article. Its nice, but there i need to mention the name of the group while setting a data connection and also at one connection i can mention the name of only one group. My requirement is like i want to get the usernames of the group which i will mention in the Contact Selector control. I am not getting any info regarding this anywhere. Can me help me in this? Regards Ginni

  • Anonymous
    May 16, 2009
    The comment has been removed

  • Anonymous
    May 18, 2009
    The comment has been removed

  • Anonymous
    May 18, 2009
    Scenario: Initiator fills out a new form opened from a Sharepoint forms library and sends it to an approver. While filling out the form the initiator selects users with the contact selector. The approver receives the form via email and opens the form to add users via the contact selector. Problem: While the initiator fills out the form the contact selector works just fine. But when the  approver opens the form from Outlook we get the following message when we try to validate a user in the Contact selector: "This action cannot be performed from untrusted sites. To use Find, you must add this site to the list of trusted sites for your Web browser." I've tried to send the form via email without the template which I would have thought would force Infopath to download the template from Sharepoint but this didn't have an effect. The publish location (Sharepoint site) is in the trusted sites list in IE. Any help would be appreciated.

  • Anonymous
    May 19, 2009
    Hi BlueChan, The reason you are seeing this behavior is when you open an InfoPath form from within Outlook it is being opened in the local IE cache (Temporary Internet Files) - as such, you will see this message. To allow the Contact Selector control to work in that scenario the form will need to be saved to the user's machine. Scott

  • Anonymous
    May 19, 2009
    Is there a group policy or some other centralized way of working around this?

  • Anonymous
    May 19, 2009
    We are experiencing the exact same issue when using the contact selector from within Outlook.   We tested this out and found that when the InfoPath form was opened from within Outlook it populated the InfoPath cache directory on the local computer with the template and the only items it seem to save to the Temp Internet Files was the images from the form and a cookie. I tried Scott's suggestion of saving the form locally after it has been sent to an Outlook client and the contact selector did work. However, this isn't a viable solution in our environment as we cannot ask our users to do this as it's not intuitive (especially since the error message infopath prompts with would only confuse them further). Even adding the local client to the trusted sites list within IE still had no effect and the contact selector was still unusable through Outlook. Is there another way around this or is this a bug? Thanks for you help.

  • Anonymous
    May 22, 2009
    Thanks for all the great info Scott. Really helped out!

  • Anonymous
    May 27, 2009
    Hi Mav - thank you! For BlueChan and robholmes...sorry for the delay as I was trying to find a way around this but I came up empty. As such, I have sent this behavior to our product team for review. Scott

  • Anonymous
    June 01, 2009
    First and last name separated by colon instead of comma using "Check Name" in InfoPath browser form "Contact Selector" Dear All, I have installed Windows hotfix for making the InfoPath 2007 client application to use comma to separate first name and last name in Contact Selector "Check Name" function. However, I published the same form to SharePoint Server 2007. It failed to separate the first name and last name with comma but colon with "Check Name" function. The form has been launched for company use and users are not satisfy with the email check name function. Please help to shed some light on how to make the "Check name" function work properly in SharePoint Server 2007. If there is any patch need to install to SharePoint server, please suggest. Thank you very much! Regards, Ada

  • Anonymous
    June 02, 2009
    Hi Ada, Are you referring to the behavior when you display an InfoPath form in the browser? If so, then yes - there is an additional server side fix that you will need for this. I am not a SharePoint/MOSS expert so I don't want to recommend what you should install as it depends on what service pack for MOSS you currently have installed. I believe the server side fix was part of an Infrastructure Update (see http://support.microsoft.com/default.aspx?scid=kb;EN-US;951297) but again I would suggest you follow-up with either a SharePoint blog or open a support case with the SharePoint team to insure you install the correct update. Scott

  • Anonymous
    June 04, 2009
    Dear Scott, Thank you for your reply! I have asked server team to consider to upgrade the service pack. Beset Regards, Ada

  • Anonymous
    June 08, 2009
    Dear Scott, It works like a charm for the new Infrastructure Update. This is the best blog for InfoPath form. Appreciate your knowledgable response. Thanks a lot! Ada

  • Anonymous
    June 09, 2009
    Hi Ada, That's great to hear! Take care, Scott

  • Anonymous
    June 14, 2009
    Рано или поздно, всем приходится писать рабочие процессы с формами ассоциации, инициализации, редактиварония...

  • Anonymous
    June 18, 2009
    The comment has been removed

  • Anonymous
    June 18, 2009
    Ahhh, it turns out to be a bug in Internet Explorer 8! It works fine with IE6, IE7 and Firefox 3. Someone else must be having this problem?

  • Anonymous
    June 18, 2009
    Hi davidevan, I am not seeing the same behavior with IE8. I just opened a test form on my site with the Contact Selector control using IE8 and I could type in the name and validate it without issue. Scott

  • Anonymous
    June 18, 2009
    Scott, thanks for the quick reply. That's interesting how it is working for you. I'm using version 8.0.6001.18702 of IE8. What version are you using? Of course I just tried again and the error still occurs. When you open an exisiting form in IE8 and you use the contact selector, does the error occur?

  • Anonymous
    June 18, 2009
    Scott, thanks for the quick reply. That's interesting how it is working for you. I'm using version 8.0.6001.18702 of IE8. What version are you using? Of course I just tried again and the error still occurs. When you open an exisiting form in IE8 and you use the contact selector, does the error occur?

  • Anonymous
    June 18, 2009
    Hi davidevan, Yes - creating a new form in the browser or opening an existing saved form in the browser works without issue for me. My version of IE is: 8.0.6001.18783 - slightly different than yours. Scott

  • Anonymous
    June 22, 2009
    Hi Scott I could create multiple contact selectors as described above - works like a charm! But how can I enforce that people have to select at least one contact? If I set the template's value "DisplayName" in the properties pane to "Cannot be blank (*)", I receive everytime I submit the form the error, that DisplayName cannot be blank, though I filled out all required fields on the form. Thank you for any help. Cheers Markus

  • Anonymous
    June 23, 2009
    Hi Markus, Yeah - this is not the easiest thing in the world to do. :) If I may ask, what is it you are ultimately trying to accomplish? (Making sure at least one user is selected before the form can be successfully submitted?) Scott

  • Anonymous
    June 24, 2009
    This blog and your posts were the most helpful thing on the Internet imo. I am having trouble still with the Contact Selector.  I used the steps you gave an earlier poster: Created a new Document Library named: ContactSelectorTest

  • Enabled the option: Allow management of content types
  • Added a new column to this library named: Responsibilities and set the data type to Person or Group
  • Clicked the Document Content Type and selected Document Information Panel settings
  • Clicked Create a new custom template The contact selector that appeared in the template was able to access the Active Directory.  My problem is that the template does not allow me to add controls to it (at least not allowing them to be added into the data source).  Vice versa, I was not able to move the working Contact Selector into the template I have been working on. Any advise is appreciated.
  • Anonymous
    June 24, 2009
    Hi Nick, Thanks... Correct - when you create an InfoPath template in this manner, the schema is locked as it is based on the library. What you would need to do is create whatever columns you need in your library and then modify the Document Information Panel. Now those additional columns will appear in the data source and you can use them on the InfoPath form. Scott

  • Anonymous
    June 24, 2009
    Thanks for the feedback. I'd prefer doing this sort of thing from Infopath as I have a form I've been working on and I don't know how to add controls like sections via adding columns to my Document Library.  I just wanted to use the Contact Selector in the form I've been working on really.  I just thought that the SharePoint method was good since it seemingly automatically configured itself to search the Active Directory.

  • Anonymous
    June 24, 2009
    Hi Nick, Yeah - you certainly have more flexibility when you start with InfoPath. When you start from SharePoint (regardless of from a content type or library) your schema in InfoPath is locked so any changes you want in the XSN need to exist SharePoint. Scott

  • Anonymous
    June 25, 2009
    Scott, Alright so I am attempting to add a Contact Selector through Infopath following the steps you gave.  I believe that I have successfully completed Steps 1-3.  I am able to drag and drop the gpContactSelector group and choose "Contact Selector" from the menu that pops up.  I have replaced <servername> in Context.xml with many different IPs/server names.  I have attempted:

  • SharePoint server name/IP
  • Active Directory server name /IP I am not really sure what the server name I need to replace <servername> with.  I'd appreciate any help. Nick
  • Anonymous
    June 25, 2009
    Hi Nick, You would simply use your MOSS WFE name. If you have multiple WFE's, I am assuming you would then have a load balanced URL and you would use that. However, if this form is to be used in the browser, then it will use the URL of the site it is published to. The server name is really only needed (in my testing) when you use the InfoPath form in the client and not in the browser. Scott

  • Anonymous
    June 25, 2009
    Scott, I tried using the IP to the load balancer and the url to my mysite on SharePoint but still no dice. Could you post an example or something of the URL you might put into Context.xml? Sorry for the hassle, I'm not very hardware or network savvy. Nick

  • Anonymous
    June 25, 2009
    Hi Nick, What do you mean by "no dice" - what is the problem? I only have one WFE, so here is what I have in mine: <Context siteUrl="http://servername"/> Scott

  • Anonymous
    June 29, 2009
    Alright! I got it working.  Thanks for hanging in there with me Scott.  I believe that I didn't save my Context.xml properly or I didn't add the data connection properly after trying different URLs in Context.xml. I have a quick question.  Once you have selected a person in the Contact Selector, how is the e-mail address information used?  All I want is to submit a form to each person selected in the Contact Selector.

  • Anonymous
    June 29, 2009
    I just read that you do not get e-mail address information from the Contact Selector.   Maybe in the next version of Infopath, they should add a field that extracts the e-mail address from a contact that is found. I should be able to get by with parsing the DisplayName attribute. Thanks again, Nick H

  • Anonymous
    June 30, 2009
    But it is doable without using any codes and here is the link to it: http://alecpojidaev.wordpress.com/ I have one question. According to the support Engineer it is posible to create a "contact selector template part" but when i try to create a template part and contact selector control is disabled and i can't add it in to my template part. Has anyone ever done that before? dvn

  • Anonymous
    June 30, 2009
    Hi dvn, This was discussed in the comments as my initial statement was not clear: the template part you create is just the "data structure" which you could then bring into your XSN. You cannot add the control itself to the template part. (Refer to my comment on Apri 16, 2007.) Scott

  • Anonymous
    July 08, 2009
    The comment has been removed

  • Anonymous
    July 08, 2009
    Hi Nick, No problem - glad I can help! Unfortunately you need to validate the user. You can see this if you drah the "Person" node to your view as a Repeating Table. That data structure does not get populated until you validate the user or users selected. And so that you are aware, the same is true if you reverse the process: if you select a user and then just delete the name from the Contact Selector control, it does not get removed from the Person node until you validate the fact that you deleted the name. Scott

  • Anonymous
    July 12, 2009
    I have an infopath form with contact selector serving as a workflow modification form. But when I click link to open this form it leads me to the sharepoint page showing "Unknown Error". This form works fine in Non shrepoint environment even I have tried it using as Task Form. It creates problem only while used as modification form. I have tried diagnostic logging as well but no log entry is generated for this error.

  • Anonymous
    July 12, 2009
    Hi Sono, If the InfoPath form works fine outside of your workflow then your best option will be to post your question to a SharePoint workflow forum or blog as we do not handle workflow issues. Scott

  • Anonymous
    July 20, 2009
    Hi, this is a great article. Although I found a tiny itty bitty problem. We are using this example to create a service form. Someone makes a request and uses the selector to make choose someone to be assigned this request to. I have a View for this form where people view requests filtered on the selectors extracted column is equal to [Me]. We then create Alerts from this View to alert our staff when something is assigned to them. However, when I publish the form, the best I can use is 'Display Name' to filter on but this gives an error when creating the view. It does not allow filtering on 'Display Name' because is multiple lines of text and using begins with or contains produces a render fail on the results of the view, hence stopping the alert. Is the anything I can do to have the column type for the contact selector form be extracted as a type 'Person'. Is there a better way about going with this?

  • Anonymous
    July 21, 2009
    Hey fraygos, I am new to Infopath so I doubt I can be of much help. A good way to understand the Contact Selector is to drag and drop gpContactSelector into your form and select "Repeating Table".  Essentially, the Contact Selector adds a row and fills in the row's values every time a contact is selected with the control.   I looked all over the Internet to find a way to try to get data from a specific row/column of a repeating table/field but I did not find anything.  Maybe you know how to do this. Anways, I'd bet that the infopath team will help you with your problem shortly. Nick H

  • Anonymous
    July 21, 2009
    The comment has been removed

  • Anonymous
    July 24, 2009
    ^That helped me a lot Scott.  Thanks. Nick H

  • Anonymous
    August 14, 2009
    The comment has been removed

  • Anonymous
    August 19, 2009
    Hi mat1583, Thank you for bringing these issues to our attention. I searched through prior support cases we have received and was unable to find where this behavior had been brought to our attention before. So the first thing I want to let you know is our product group was not aware of these behaviors. I have been able to reproduce the behavior you describe in both Firefox and Safari and will be submitting these to the product group for review. However, I don't have a time frame on if/when this may be addressed. Thanks again, Scott

  • Anonymous
    August 20, 2009
    Thanks for the reply, Scott. I was able to workaround the 'can't delete' issue by adding a clear button which uses a rule to clear AccountID, DisplayName, AccountType and reset our user count (since we have validation to limit to only 1 user). Safari and FireFox together make up a third of our traffic, so the extra blank user problem could be pretty confusing for a lot of people. This post was EXTREMELY helpful for me, but it was a big disappointment to get this far and discover problems like this. Hopefully it will be resolved soon. I'd love to use it in other forms we're developing if it will function correctly in other major browsers.

  • Anonymous
    August 20, 2009
    Thanks mat1583 - I am glad you found this useful! I have submitted this behavior to our product group so hopefully this is something we can look at for a future service pack. Scott

  • Anonymous
    August 25, 2009
    Hi! I'm working with an InfoPath form which must have some Contact Selector controls to validate users from the MOSS server's AD. I've done all steps as they're explained in this post, but the contact selector does not validate any user, and when I try to search for users clicking on the "To" button, it could not search for them. I've already tried to change server name with IP address in Context.xml, but still can't search or validate users. What could be the cause of this problem? Thanks in advance.

  • Anonymous
    August 26, 2009
    Hi minhasquier, Can you verify that the node names in your data source are spelled correctly AND the capitalization matches what is in this post? Scott

  • Anonymous
    August 26, 2009
    Hi Scott, I've checked it. All the groups that I am using with contact selector have the same structure, including correct spelling and capitalization, as it's specified in the post.

  • Anonymous
    August 26, 2009
    The comment has been removed

  • Anonymous
    November 17, 2009
    Hello, Great instructions! Thanks. In testing the instructions there is an error submitting the form when I click to resolve the name. I went back to the template and ran the design checker and got "The SOAP message could not be parsed" Any tips? Thanks.

  • Anonymous
    November 17, 2009
    Hi aliciapq, The first thing I would do is start over with a new, blank XSN and insure that you have named everything identical (including capitalization) to what I have here in this post. Then test and see if you have any different behavior - most issues I have seen stem from either the data source not being constructed correctly or the names not be either spelled/capitalized correctly. Scott

  • Anonymous
    December 07, 2009
    The comment has been removed

  • Anonymous
    December 16, 2009
    Hello Scott The Contact Selector generated by ContentType schema throws AccountId as an integer (which is User Id), it doesn't gives the username. Has anyone come across this issue? I will appreciate if Scott or anyone can help me on this. I am nearly there and just stuck on this problem. Thanks in advance. kk

  • Anonymous
    December 16, 2009
    Hi kk, Is this InfoPath 2007? Also - when does the error occur? I need a little more detail on what you are doing when the error occurs. Scott

  • Anonymous
    January 11, 2010
    About the bug in FireFox/Safari... interestingly enough SP2 fixes the peoplepicker control within general SharePoint, like if you add New Users to a group or such. It used to have exactly the same buggy behaviour where it didn't work in those browsers, and it's been resolved. But looks like the hotfix doesn't affect where InfoPath renders the control in forms. So even with SP2, you can't correctly start a Review workflow against a document on the Workflow Initiation Form, as this is rendered by InfoPath. Pity the fix didn't apply to both instances of the control! Scott, I guess we don't have any idea if they could use that hotfix against the InfoPath version do we? :(

  • Anonymous
    January 11, 2010
    Hi gpollock, I am unsure if the same fix could be used in the Contact Selector control that was used in the SharePoint People Picker control. However, although a fix for this did not make it into SP2 it is something we are looking at for our next version. Scott

  • Anonymous
    January 12, 2010
    Thanks Scott, I presume you mean next version SP3, or possibly hotfix before? Not next version 2010 :)  (I hope!) Cheers Gavin

  • Anonymous
    January 12, 2010
    Hi Gavin, "Next version" is 2010 - this is where we are looking to try and correct the behavior. Scott

  • Anonymous
    January 17, 2010
    ok.. first fo all thank you. my problem is a little strange. i added the contact selector and it works. i click "To..." and i search for the contact and i get results, i select a contact and click add then ok. and BOOM error submitting the form! i did not submit the form!! i simply clicked OK after choosing my contact!! all that is in the browser form, but on the local machine, also everything works up to the point where i click ok after selecting the contact, then the contact selector turns gray and if i submit the form the corresponding column in the library is empty. i need your help on this one and i appreciate it :) thanks in advance

  • Anonymous
    January 17, 2010
    Hi osami.tamini, If the Contact Selector control turns "gray" then the only time I have seen this occur is when you do not have the data structure setup correctly or the node names spelled correctly...including capitalization. Please compare the spelling of your node names to what is documented in this blog and make sure they match EXACTLY what is shown here. Scott

  • Anonymous
    January 17, 2010
    The comment has been removed

  • Anonymous
    January 17, 2010
    Hi, The "Person" node is not spelled correctly...assuming that was just a typo when you entered here in your comments, then the next step is to make sure you have the node types correct: Person - this is a "Repeating Group" AccountId, AccountType and DisplayName are just "Field (element)" data types Scott

  • Anonymous
    January 17, 2010
    actually no, it was not a typo, it was a copy paste from my elements. and that was the problem. now everything works great thank you so much.. i know i look stupid specially that i read most of the comments and not just on this site, but on other and i was telling my self, guys please make sure your elements names are correct before you assume there is something wrong! lol this is really embarrassing. anyways, please accept my apologies. and i need your help on something else. in the form im creating i need to have multiple contact selectors. 1-To.   2-Addressed To. 3-CC. 4-From. 5-Secretary i tried to use the same steps here to create a template but when i try to add the Contact Selector activeX controlit says "the custom control you have added is not compatible with the form template or template part, and will be hidden in the controls task pane." any suggestion!?

  • Anonymous
    January 17, 2010
    No problem - glad it was that easy! :) In regard to multiple controls, take a look at my comments from May 22, 2007... Scott

  • Anonymous
    January 18, 2010
    scott, that is great, thank you so much.

  • Anonymous
    March 02, 2010
    Hi Scott, I'm new to creating XML files and I have the following error "The 'Context' element is not declared." I added the control to the form and publish.  When I select the To button, type a name, click Go, and it shows the control searching, then I get an Search failed message. Do you have any idea what may cause this? Thanks, Nichelle

  • Anonymous
    March 11, 2010
    Hi Nichelle, My apologies for the delay in responding as I was on vacation. :) Have you resolved the "Context" element error yet? If not, then honestly no, I have not seen this error before. Did you follow the steps in this blog exactly as they appear? Also - what version of InfoPath are you using? Scott

  • Anonymous
    March 22, 2010
    Hi I'm creating a new form and read your article, but when doing the preview and click the "to" button I get a window with no names. I guess I'm not pointing the XML file to the right place. What should the server format be like? This is my outlook server: GVW1162EXB.americas.hpqcorp.net Also, does is have anything to do, that I haven't pubilshed the form yet and that's why I don't see any names appearing when I click on the "To" button?

  • Anonymous
    March 22, 2010
    Hi namariegaudi, The URL in the context.xml file needs to point to your "SharePoint" or MOSS server - not an "Outlook" server. So if you want to use your root site collection of your server, the XML file would be as described in this blog: <Context siteUrl="http://servername"/> However, if you wanted to use a subsite, it would be like this: <Context siteUrl="http://servername/site"/> Scott

  • Anonymous
    March 23, 2010
    Great!!! it works!!! One final question though...if I need separate emails fields to be added do I need to redo the steps described above or I can just copy the Contact Selector to other places?

  • Anonymous
    March 23, 2010
    Hi namariegaudi, You cannot just "copy" the contact selector elsewhere and get it to work...take a look at my comments from May 22, 2007 for how to add multiple contact selector controls to one InfoPath form template. However, if you just need multiple selections, you may want to look at putting the contact selector control in a "repeating" section or table and then use a custom function to pull all the addresses. For this scenario, take a look at my April 30, 2009 comments. Scott

  • Anonymous
    March 24, 2010
    I want to create a "workflow" the requestor, enters their email and data for approval along with a first level approver & a second level one. Once the requestor enter all data. I want an email sent to the 1st level requestor either approving the project. If approved, then I want the email going to the 2nd level approver. If both values are "approved" then requestor gets an email notification. If at some point 1st or 2nd level approvers reject the data another email will inform the requestor. Can this be done via rules in InfoPath? FYI, I'm not using contact selector for requestor's email...only for 1st & 2nd level approvers

  • Anonymous
    March 24, 2010
    Hi namariegaudi, Yes - this should be doable using Rules in InfoPath. Scott

  • Anonymous
    March 24, 2010
    Scott here's what I did, but it doesn't seem to work. Need help.

  1. I selected the person group abd clicked on properties
  2. Added a condition that AccountId is not empty. Should it be a condition that AccountId, DisplayName & AccountType shouldn't be empty?
  3. I setup an Action to submit email via a data connection
  4. My data connection has as receiver the gpContactSelector and I'm sending the form in active view (not as an attachment) For some reason when entering a project in the form and saving it in SharePoint the rule doesn't start and hence no email is sent. Am I missing something?
  • Anonymous
    March 24, 2010
    Hi namariegaudi, I misunderstood how you were doing this...I didn't understand you were trying to add a Rule to the Contact Selector control. As you can see, that won't work. Normally what is done is, after everything is filled in the way you want, you have a Rule on a "button" to submit the form, send the mail, whatever. Then in the condition for this Rule, you can make sure that whatever fields are "required", they are not blank. Scott

  • Anonymous
    April 26, 2010
    Hi Scott, I am having a wierd problem and I am kinda stuck. I have got SharePoint DIP in InfoPath bound to a SharePoint content type. Now there is a field of type User in that CType, InfoPath automatically created a people picker, issue is the AccountId stored in this field is the interger id of User Information List and not the account name because the inline type of that field is dms:UserID and not xsd:string. Because its an interger and not accountname I can't call GetUerprofileWebService. So I tried getting the accountname from UserInformationList using the accountid, however if I lookup a user using people picker and if that user has not accessed the site before he desn't exist in UserInfo list which means my GetuserProfileService method fails. Would you have any workaround for this? I will be very thankful if we can get a workaround for this problem as my system is nearing an end. Thanks in advance, Kunal

  • Anonymous
    April 27, 2010
    Hi Kunal, The only way I can think of to get this to work in cases where a user has not accessed a site yet, would be to create a custom web service that would take the "Display Name" of the selected user, find that user in Active Directory and then return the associated information about the user that you need. In other words, you would be using your own "custom" process to get the user's information. If not, then the only way I know if is to convert the SharePoint ID of that user to the appropriate account but as you noted, this will be an issue if the user has never accessed the site before. Scott

  • Anonymous
    May 13, 2010
    The comment has been removed

  • Anonymous
    June 07, 2010
    The comment has been removed

  • Anonymous
    June 20, 2010
    sbernard, Sorry for the delay in responding... So it sounds like you are using the Contact Selector control to select a user then you want to get more information about that user using the GetUserProfileByName web method of the UserProfile web service - is this correct? If so, then you will want to verify a few things:

  1. The GetUserProfileByName data connection should not fire when the form first opens unless you need to get information first for the user opening the form
  2. When you click the button to get the details for the user you selected in the Contact Selector control, you need to make sure the first action in your button Rule is "Set a field's value". What you need to do here is set the "AccountId" in the queryField from the GetUserProfileByName data connection to the AccountId field value from the Contact Selector control.
  3. Once you have the AccoundId field populated, then you will query the GetUserProfileByName data connection. This should then return the profile information for the user you selected. I hope this helps! Scott
  • Anonymous
    September 27, 2010
    Hi there, I have created an infopath form using the contact selector and everything works fine when I use in Infopath, however when I try to fill out the form in the browser my form freezes. If I wait I can add a person to the Contact Selector, then I try to add one to the second contact selector and it freezes again.  It is obviously then the contact selector which is making it freeze.  Any ideas? Many thanks

  • Anonymous
    October 03, 2010
    Hi Emily, To the best of my knowledge, I have not seen this behvior before. A couple if things to look at:

  • Are you on the latest Service Packs for Office/InfoPath and for Microsoft Office SharePoint Server?
  • Are you using the latest version of Internet Explorer?
  • Try enabling "Verbose" logging on the server for the "All" category, reproduce the issue and then check the latest log to see if there are any errors getting logged when you try this process
  • You may want to look at using the "Fiddler" network tracing tool to see if you can see what call it is hanging on
  • As a last resort, if you are unable to isolate the cause, you may want to open a support ticket with the InfoPath team to allow them to see the behavior, capture some trace logs, etc. Scott
  • Anonymous
    October 11, 2010
    Hi Scott Here's the scoop. I have a custom Word Template that contains a custom DIP. That DIP contains two contact selectors. They work fine and as expected, however, every once in a while (2 - 7) entries of new documents created by the template crashes Word. I've narrowed it down to the contact selector. It will post a message that it is accessing the web service and then Word crashes with this error message: faulting module contactpicker.dll The DIP is not connected to a SharePoint list and is used only to populate content fields in the template. This has got me stumped. Fiddler tells me that the XML is coming back from the webService so I'm sure it's not connectivity. I just can't trap an event to tell me why contact selector has failed. Any thoughts would be much appreciated. Michael.

  • Anonymous
    November 01, 2010
    I follwed your instructions to the T, the only confusion I encontered is while creating the Context.xml,  in the XML Context the Servername can it be the actual Exchange server url or has to be the SharePoint site url where the infopath form resides? I inserted the SharePoint site URL in quotes .... <Context siteUrl="http://paportal.swmed.org"/>  but when I do the search it is failing.  Gives me Search Failed. Any suggestions? Thanks! RMall

  • Anonymous
    November 01, 2010
    I am new to infopath.  I followed the instructions but upon testing the form, when I do a search for a person I get Search failed. I am pointing my Context xml url to my SharePoint main site.  Do I need to point to the SharePoint site that contains the infopath form?  OR can I point to the Exchange Server? Any Suggestions? Thanks! NH

  • Anonymous
    November 01, 2010
    I am new to infopath and I followed the instructions.  But when I do a search for the person I get Search Failed. I am pointing to my SharePoint site in the Context xml i.e.  <Context siteUrl="http://paportal.swmed.org" /> Any suggestions why am I getting Search Failed? I have a SharePoint Farm with a Main Site and the form is loaded on a Subsite. Thanks RMall

  • Anonymous
    November 01, 2010
    RMall and NH: You should enter a URL to the SharePoint site where the InfoPath form will be used...it cannot be an Exchange Server. Now, with that said, the Context XML file is only used when the form is opened in the InfoPath client. If you are using these forms in the browser then it simply uses the site where it is published. So with that said, I am going to assume you are using these forms in the browser...if so, what happens if you perform a search for the same user but in a SharePoint screen (i.e. when you need to add permissions for a user) - does it fail there as well or does that work? Scott

  • Anonymous
    November 07, 2010
    Michael, Sorry for the delay...I have not seen an issue like this nor can I reproduce it in the tests I have tried. If you start fresh and have a consistent repro then I would suggest opening a case with the InfoPath Support team so we can take a look at this in greater detail. Scott

  • Anonymous
    November 17, 2010
    Hi Scott, the control change event is not functional in browser enabled forms. is this a bug for 2010? thanks

  • Anonymous
    November 18, 2010
    Hi, Regarding the changed event in the Contact Selector control - it appears you are using InfoPath 2010 to create an InfoPath 2007 compatible form template. If this is the case, then yes - the changed event is not available. However, if you create an InfoPath 2010 XSN, then it will be available. If you are indeed using InfoPath 2010 to create an InfoPath 2007 compatible XSN, I did try these steps and they appear to work:

  • Change the Compatibility to one of the 2010 formats
  • Add the Changed event and your code
  • Test to make sure it works as you need
  • Save
  • Change the compatibility back to 2007 Scott
  • Anonymous
    November 26, 2010
    The comment has been removed

  • Anonymous
    November 29, 2010
    The comment has been removed

  • Anonymous
    January 12, 2011
    Hi, Thanks for your post. This is really a helpful and useful post. I have successfully added the control into my form following this article. It works fine in my pc (form development pc) but I have got 'search failed' message from other pc. What should I do now?

  • Anonymous
    January 16, 2011
    Hi Dewan, A few questions:

  • Is the other PC a client machine?
  • Are you hitting the same site?
  • Are you logged onto the other machine as the same account you used from your machine? If not, log onto that machine as yourself and make sure it still works.
  • If it works for you and not the other user, does the other user have appropriate permissions? What happens if they just use Internet Explorer, browse to your site and try to do something that requires a search like this (i.e. add themselves to a group, etc.) - does it work directly in SharePoint? You also may want to try getting a "Fiddler" trace (http://www.fiddler2.com) and see if this shows any failure that may help you isolate the problem. Scott
  • Anonymous
    March 23, 2011
    The comment has been removed

  • Anonymous
    April 28, 2011
    Is there any additional trick to getting the contact selector control to work on a form that already has digital signature controls on it?  When I add a contact selector to an InfoPath 2007 form that uses digital signature controls and configure the context, the lookups from the control don't seem to do anything.  I'm wondering if there is contact selector logic in the digital signatures or something else that is conflicting with the contact selector I'm adding?

  • Anonymous
    April 28, 2011
    The comment has been removed

  • Anonymous
    May 17, 2011
    I've followed the instructions and was able to make it work, but for some reason when I tried again on a new form it doesn't work.  When I preview the form and select "to"  I'm able to search the names from the active directory, but when transferred over to the form, the name won't generate and it control gets grayed out.  Am I doing something wrong? Thanks!

  • Anonymous
    May 17, 2011
    Hi Meghann, Typically the behavior you are seeing is because one or more of the fields for the contact selector is either not spelled correctly or is not capitalized correctly. Can you please check that the field names are identical to what is in the blog and have the same capitalization? Scott

  • Anonymous
    May 18, 2011
    Hi Scott, It still doesn't work and I rechecked over and over that it was correct. Any other tips? Thanks, Meghann

  • Anonymous
    May 19, 2011
    Hi Meghann, If the context.xml file is pointing to the correct URL and you have verified the spelling and capitalization of the node names in the data source, then no...unfortunately I am out of ideas. These have been the only cases where I have seen the control get grayed out. If you are unable to get this working then you may want to open a support case so the InfoPath team can look into this deeper for you. Scott

  • Anonymous
    June 19, 2011
    i want to use the data to a workflow in designer how can i seperate the users when i try to reach the data, i get only the first user any suggestions? thaks, Dana

  • Anonymous
    June 19, 2011
    Hi Dana, I am assuming what you are referring to is the behavior you get when you "promote" the Contact Selector node to a column in SharePoint? If so, then try using the "merge" function - this should give you a concatenated result of the users you have selected in the control. Scott

  • Anonymous
    June 19, 2011
    The comment has been removed

  • Anonymous
    June 20, 2011
    Hi Herlisson, Off hand, I don't know what would cause that error. What I would suggest is to enable "Verbose" logging on your server for the Forms Services categories, reproduce the error and then check the SharePoint ULS logs...hopefully there will be additional details in the logs that point you in the right direction. Scott

  • Anonymous
    July 27, 2011
    Scott, 4 years after this was posted, this is the most helpful post for getting the contact in there! Thanks again! Steven

  • Anonymous
    July 27, 2011
    The comment has been removed

  • Anonymous
    July 27, 2011
    Disregard!  I read further down to a post by Meghan on May 17 and I had the same problem.  Bad spelling/capitalization.  Talk about picky Infopath forms!  :) Thanks again, this is a huge lifesaver!

  • Anonymous
    March 04, 2012
    Awesome post.  Here’s a tool that lets you build all types of web forms with email alerts fast and without coding. Just point and click www.caspio.com/.../web-forms-online.aspx

  • Anonymous
    March 29, 2012
    If this control could also return users' phone numbers from the SharePoint site, that would be ideal.

  • Anonymous
    November 08, 2012
    hi Scott i hope you are still here and can help me :D i have several contact selectors in my infopath form. i have been trying to set default valu for all of them, but it is not working. first i was trying it with the resolveprincipal data connection (people.asmx) and add those six rules for each contect selector in the Tools menu choose Form Options -> Open and Save. when it is all done i set the domainusername for all cotact selector's display name and after i publis it to a sharepoint server and create a new document all contact selector are epmty, except those which has my name in it. so i create a new document, i save it, and when i open it all contact selector are empty. second i was trying it with the getuserprofilebyname data connection and set all 3 nodes: DisplayName - use the PreferredName attribute from the UserProfileService GetUserProfileByName web method AccountId - domain name of the user in the form domainusername (can manually concatenate your doman name + + userName() or use the AccountName node of the GetUserProfileByName web method AccountType - Just the word "User" is fine if it's a user when its done, the contact selector has the domainusername but it does not resolve it. please help me. i have been trying to figure this out for 2-3 days and grrrrrr :D

  • Anonymous
    November 17, 2012
    i think easy to pratice your..... explanation step by step thanks http://www.pembolang.com

  • Anonymous
    November 29, 2012
    Hi BearCheese, Sorry for the delay...are you using InfoPath 2007 or InfoPath 2010? And if 2010, are you saving the XSN in the new 2010 format or the 2007 format? Scott

  • Anonymous
    January 24, 2013
    Hi Scott Thanks, but i managed to make it work. actually its very easy. all i needed to do was retrieving data from active directory by getuserprofilebyname.

  • Anonymous
    February 09, 2014
    The comment has been removed