Using Multiple-Selection List Box for Email Recipients - InfoPath Dev
in

InfoPath Dev

Using Multiple-Selection List Box for Email Recipients

Last post 11-25-2015 12:55 PM by rutica. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 02-21-2008 01:25 PM

    • jlewis
    • Not Ranked
    • Joined on 02-21-2008
    • Posts 5

    Using Multiple-Selection List Box for Email Recipients

    I searched the forum but did not find someone wanting to do what I want.  I want to have a Multiple-Selection List Box that has a preset list of email addresses in it.  The user fills out the form and selects which email addresses will receive the form from the multiple selection list box (the user may select all or some addresses).  The problem is when I set my submit button to pull the email addresses from the list box, only 1 email gets populated in the "To:" field.  What can I do to have the multiple emails selected and added to the "To:" field when submitting?  The new multiple selection list box seems like a great way to pull this off.  What am I doing wrong?

    Here is a screenshot of what I'm after and where I am so far:

     Thanks,

    Jeff
    Infopath 2007

  • 02-21-2008 02:33 PM In reply to

    Re: Using Multiple-Selection List Box for Email Recipients

    The trick is you are trying to put repeating information into a non repeating field.  Email addresses need to be concatenated together with a ; seperating each.

    I know with code you could process through the list and build the "to" field.

    I think you could build it with a rule, as a name is selected, the corresponding email could be concatenated onto the end fo the list.  concat(tofield, ";", picker)

    Two issues though you would need to switch to a drop down and then display the selections in another control. With the multilist the first picked value would always be passed :(  Another issue is if they change their mind and unselect.

    Best would be to create a repeating list with a selection box field. Name, Email, SelectFlag.  So as they were chosen you could have a check box bound to the selectflag which would replicate your current view.

    You should look an Active Directory web service or using SharePoint so you do not have to keep your own list but let them look them up emails from the network.

  • 02-21-2008 04:42 PM In reply to

    • jlewis
    • Not Ranked
    • Joined on 02-21-2008
    • Posts 5

    Re: Using Multiple-Selection List Box for Email Recipients

    Thanks for the reply.

     I will only have about 5-10 emails hard coded in the form so using Active Directory or Sharepoint is not needed.  Plus the emails that I will be using are external emails not in our company directory.  I just can't believe there isn't an easier way to do this.  I'm fairly new to InfoPath so I won't be able to write any code to do this. 

    I will try your suggestion with the repeating list and selection box.  If anybody else has any ideas for using the multiple-selection list box let me know.

    Thanks,
    Jeff

  • 09-09-2010 12:45 PM In reply to

    Re: Using Multiple-Selection List Box for Email Recipients

    I'm in a very similar situation.  I have an Infopath form sitting in a Sharepoint Document library  and i want the main User to be able to choose from a list of names (subset of company names but not nearly as many) and using worflow, assign a to-do task to each person in the list to review the form and add some comments.  This allows the Main user to be able to easily tell when all reviews are complete.  However, when the workflow runs, the assigned to gets left blank since it can't resolve the name from the multiple-value selection box field containing the list of names.  The workflow itslef works fine if i hard code a name or address in the worflow designer, but not if i try to assign a value from the form to the workflow's "assign to".  Any help would be greatly appreciated.

  • 09-11-2010 06:51 PM In reply to

    Re: Using Multiple-Selection List Box for Email Recipients

    You can use the eval function to concatenate the selected email addresses.

    So if your data source is structured like

    myFields
         UserList (parent group)
             emailAddress (child repeating field)

    Your formula would be: eval(eval(emailAddress, 'concat(., substring(";", 1, string-length(.)), " ")'), "..")

    You use this formula in your Email Submit data connection's "To" field. You should be getting the result as shown in the image:


     

    I attached a sample form to get you started.

     

    Hope that helps!

    Mel Clemente
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

    Filed under:
  • 07-30-2012 11:42 PM In reply to

    Re: Using Multiple-Selection List Box for Email Recipients

    Hi.

    I was wondering if you could send me the form as I have a similar problem which I just can't get a handle on

     

    Regards

     

    Steve

    Filed under:
  • 07-31-2012 09:14 AM In reply to

    Re: Using Multiple-Selection List Box for Email Recipients

    No worries Steve - XSN attached. :)
    Mel Clemente
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 07-31-2012 02:54 PM In reply to

    Re: Using Multiple-Selection List Box for Email Recipients

    Perfect answer for me. Thanks Mel :-)
    Filed under:
  • 02-03-2015 02:12 AM In reply to

    • pavr27
    • Not Ranked
    • Joined on 02-03-2015
    • Posts 2

    Re: Using Multiple-Selection List Box for Email Recipients

    Hi All, appreciate this is an old thread - but seemed a suitable place to post.

     

    Firslty, I am an infopath novice, and cannot code.

    I'm using Infopath 2007

    I am trying to achieve similar to this. Difference being my multiple selection list is populated from a SharePoint list.

    The multiple selection list pulls a list of countries. These countries are associated with email addresses.

     

    What I want to achieve:

     

    When I select a country in the list, the associated email addresses appear, concatentated, in the text box so that I can then send an email to the recipients.

     

    I've had a look at the example solution above, but can't work out how to modify this correctly. What I did is change the list box properties to pull from my secondary source, and then tweaked the expression box formua to:

     

    eval(eval(@Approver, 'concat(., substring(";", 1, string-length(.)), " ")'), "..")

     

    But it's not working - all email address are displayed in the expression box, independentl of whether or not the assosiated country is 'checked'

     

     

    My secondary source looks like:

     

    And the resulting frm looks like:

     

     

     Any pointers please?

     

    Many Thanks!

     

     

  • 02-09-2015 01:39 AM In reply to

    • pavr27
    • Not Ranked
    • Joined on 02-03-2015
    • Posts 2

    Re: Using Multiple-Selection List Box for Email Recipients

     Anybody?

  • 11-25-2015 12:55 PM In reply to

    Re: Using Multiple-Selection List Box for Email Recipients

     I am having a similar situation as Pavr27.

     

    Is there a solution to do this?

     

    Thanks! 

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