How can retrieve email address from the Infopath people/Group picker - InfoPath Dev
in

InfoPath Dev

How can retrieve email address from the Infopath people/Group picker

Last post 04-09-2013 06:17 AM by gregc72. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 12-13-2010 02:20 PM

    How can retrieve email address from the Infopath people/Group picker

    How can retrieve email address from the Infopath people/Group picker?When I add the people/Group picker into the infopath form, I only get 3 fields DisplayName,AccountId,AccountType.Can anyone show me how can I get the email either by configurations or by code.

    Filed under:
  • 01-09-2011 03:47 PM In reply to

    Re: How can retrieve email address from the Infopath people/Group picker

    What do you need to do with this email address?  The AccountId value works for sending emails if you're trying to send workflow emails based off this field.  If that's not good enough, you can retrieve the WorkEmail value of the user's profile from the User Profile Service by using the technique on my blog.  You must first set the query parameter of GetUserProfileByName to the AccountId value, then query, then set some other text field to the WorkEmail value of that data set.  You can't add this value to the Contact Selector schema, though, so don't bother with that.

    One trick you'll need to know is that you can't fire a rule on the Contact Selector nodes, so you'll need to do this:

    1. Create a dummy text field called "username" that won't be shown on the form
    2. Set its default value to the AccountId node of the Contact Selector
    3. Add a rule to the username field that first sets the AccountName query field of GetUserProfileByName to the username field, then queries the web service, then sets the email field's value to WorkEmail per the article above
  • 01-11-2012 01:15 PM In reply to

    Re: How can retrieve email address from the Infopath people/Group picker

    I am having a problem related to this,

     I have a people/group selector on a sharepoint site which infopath is to read and use for sending email but when AccountId is pulled down it add an extra comma to the AccountId witch outlook doesn't recognize

     example:   "smith, bob" is what I want "smith,,bob" is what I get.

     I check the information on the sharepoint site and it is ok, and all my other people/group picker in infopath work so it something in the data connection.

  • 01-11-2012 02:51 PM In reply to

    Re: How can retrieve email address from the Infopath people/Group picker

    got it resolved just used substrings
  • 04-09-2013 06:17 AM In reply to

    Re: How can retrieve email address from the Infopath people/Group picker

    I'm having the same issue. "I used substrings" was a little vague but enough to go on and do a little research.

    What I'm doing is setting a People picker with a rule based on the selection of another piece of data. I get the double commas.

    In the rule I set the Field which is a lookup to a secondary data source with some filtering then the text looking for in this case ",," and what I wanted to translate it to "," using the Substring Translate function.

    So, My Rule Value looked like this  translate(DisplayName[Project_Number = Project Number], ",," , ",") This did not accomplish what I thought it would, still returned the double comma.

    Could you elaborate on what you did a little bit more? Thanks.

     

Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.