Using Contact Selector to Send Emails to Multiple Users - InfoPath Dev
in

InfoPath Dev

Now you can find InfoPathDev on YouTube and Twitter!

Using Contact Selector to Send Emails to Multiple Users

Last post 07-08-2009 06:34 AM by Alec Pojidaev. 30 replies.
Page 1 of 3 (31 items) 1 2 3 Next >
Sort Posts: Previous Next
  • 12-16-2008 05:04 AM

    • WSU54
    • Not Ranked
    • Joined on 09-11-2008
    • Posts 14

    Using Contact Selector to Send Emails to Multiple Users

    I have a form which basically sends an email.  I have two instance of the Contact Selector control simulating the "To" and "CC" fields as you would have in a regular email.  The Contact Selector allows the user (by default) to choose more than one recipient.  However, my issue come in that regardless of what method I try, I cannot capture anything beyond the first user in my SharePoint Designer workflow. 

    I ran some tests and it looks like the problem originates in InfoPath.  It only wants to promote the first value from the Contact Selector.  I have tried to put the Contact Selector in a repeating group, push the values to a textbox that would promote the string, used a dynamic variable in the workflow to capture the string, but nothing has worked.  It seems to me that while the Contact Selector lets me pick more than one user, it ignores the second which allows my workflow, property promotion, etc. to complete successfully but only because they don't "know" that the second user was chosen. 

    Is there a way, code or non-code based to capture that second user and use it to populate the "To" and "CC" fields that the workflow kicks off?

    Thanks!

  • 12-16-2008 05:16 AM In reply to

    Re: Using Contact Selector to Send Emails to Multiple Users

    Hi,

    The schema of the contact selector should be specified like in the following link. Once go through the link.

    http://blogs.msdn.com/infopath/archive/2007/02/28/using-the-contact-selector-control.aspx

    If you still face the same issue let me know.

     

    Swathip
    www.ggktech.com
  • 12-16-2008 05:25 AM In reply to

    • WSU54
    • Not Ranked
    • Joined on 09-11-2008
    • Posts 14

    Re: Using Contact Selector to Send Emails to Multiple Users

     This is exactly how the Contact Selector is configured.  It works, but only for the first user I pick. 

  • 12-16-2008 05:58 AM In reply to

    Re: Using Contact Selector to Send Emails to Multiple Users

    How you are picking the second user? Can you give more details?
    Swathip
    www.ggktech.com
  • 12-16-2008 08:02 AM In reply to

    • WSU54
    • Not Ranked
    • Joined on 09-11-2008
    • Posts 14

    Re: Using Contact Selector to Send Emails to Multiple Users

    I can select multiple users by 1) double-clicking two or more user names in the search mode or 2) simply enter two names (separated by ; ) and click the check names button.  It allows me to select the users, it will validate both names, but will not "pass" bnoth names to my email WF.

  • 12-16-2008 11:57 AM In reply to

    Re: Using Contact Selector to Send Emails to Multiple Users

    I have a blog with solution exactly for that problem

    You don't need workflow to form string with emails. Do everything in InfoPath.

    http://alecpojidaev.wordpress.com/2008/12/16/infopath-codeless-programming-walkthrough/

     Edit: The new changes been applied to support web-based forms.

  • 12-16-2008 05:55 PM In reply to

    • WSU54
    • Not Ranked
    • Joined on 09-11-2008
    • Posts 14

    Re: Using Contact Selector to Send Emails to Multiple Users

    I think this will do it...however, I am having an issue in that it if I use the Contact Selector to enter three names, so...

    In the Contact Selector, I choose:

    User 1; User 2; User 3

    In the "HlinkToEmail" control only shows:

    User 1;  User 1;  User 1

    Any ideas?

  • 12-16-2008 06:39 PM In reply to

    Re: Using Contact Selector to Send Emails to Multiple Users

    I had that problem until started using function number() in referencing expessions like that: referencedNode[number(integerTypeNode)]. For some reason It's not enough to be an integer node for proper referensing.

  • 12-17-2008 05:28 AM In reply to

    • WSU54
    • Not Ranked
    • Joined on 09-11-2008
    • Posts 14

    Re: Using Contact Selector to Send Emails to Multiple Users

    I'm not sure that I understand what should be changed vs. what is instructed in your blog article.

    Using the sample provided on your blog, I pasted the following formula into the first action:

    ../my:replyToControl/my:Person[number(/my:myFields/my:fCounter)]/my:AccountId

    I renamed "replyToControl" to "To" to match my data source in my form.  So I have:

    ../my:To/my:Person[number(/my:myFields/my:fCounter)]/my:AccountId

    I double-checked and my control "fCounter" is of "Whole Number (integer)" type.

    Thanks!

  • 12-17-2008 06:29 AM In reply to

    Re: Using Contact Selector to Send Emails to Multiple Users

    First I would try to check if iteration is happening at all. For that you need temporary replace XPath expression in 3rd action to

     concat(../my:HlinkToEmail,”;”,../my:To/my:Person[number(/my:myFields/my:fCounter)]/my:AccountId)

    so if iteration is working the result should be concatenation of login names.

     Also make sure that 2 actions to assign initial values to fCounter and HlinkToEmail fields are in the rule of your To group.

  • 12-17-2008 07:04 AM In reply to

    • WSU54
    • Not Ranked
    • Joined on 09-11-2008
    • Posts 14

    Re: Using Contact Selector to Send Emails to Multiple Users

    OK, that worked...except that it is a browser-based form and I get the following error when publishing:

    The following expression could not be parsed because of a syntax error or because it uses an unidentified namespace prefix or unsupported function:

    ../my:HlinkToEmail,”;”,../my:To/my:Person[number(/my:myFields/my:fCounter)]/my:AccountId

     

  • 12-17-2008 07:13 AM In reply to

    Re: Using Contact Selector to Send Emails to Multiple Users

    Take a look on quotes you are using ”;”. They are wrong ones.  Use ";"

  • 12-17-2008 07:20 AM In reply to

    • WSU54
    • Not Ranked
    • Joined on 09-11-2008
    • Posts 14

    Re: Using Contact Selector to Send Emails to Multiple Users

     

  • 12-17-2008 07:21 AM In reply to

    • WSU54
    • Not Ranked
    • Joined on 09-11-2008
    • Posts 14

    Re: Using Contact Selector to Send Emails to Multiple Users

    That is simply the rich text editor on this forum.  I checked the formula in my InfoPath form and they are ";"

  • 12-17-2008 07:29 AM In reply to

    Re: Using Contact Selector to Send Emails to Multiple Users

    Please check it twice. I noticed that my initial post had wrong quotes and it's posible to copy/paste them into InfoPath. So if you hadn't fix them intentionaly they should be wrong ones.

Page 1 of 3 (31 items) 1 2 3 Next >
Copyright © 2003-2010 Qdabra Software. All rights reserved.
View our Terms of Use.