locked
InfoPath email submission and repeating tables RRS feed

  • Question

  • I was looking for help on a particular issue where I cannot seem to get the correct result.  Background:

    Creating a form within InfoPath to submit to SharePoint.  One of the submit options is to send an email to the listed individuals who are impacted by a change.  I was running into issues that would not allow me to pull multiple names from a people picker box.  I searched the web and found an old thread listed below on this site that showed how to loop and eval and concant to achieve this, but I am not getting the expected results:

    http://blogs.msdn.com/b/infopath/archive/2006/04/05/569338.aspx?CommentPosted=true&PageIndex=1#comments

    Current state:

    When I create the loop, and publish, I get the following effect:

    The first email address is listed twice in the CC field.

    I am using the people picker option, however, I created a manual table and manually entered emails and got the same result.  

    Here is my xpath:

    xdMath:Eval(xdMath:Eval(/my:myFields/my:email/my:Change_Implementer_Primary/pc:Person, 'concat(/my:myFields/my:email/my:Change_Implementer_Primary/pc:Person/pc:DisplayName, ";")'), "..")

    My repeating table is set as follows: (people picker)

    myFields

     email (this is a repeating table)

       Change_Implementer_Primary (this is a required field)

         pc:Person

           DisplayName

           AccountId

           AccountType

    I am way stuck as to why the loop is picking the same email name twice when there are two email names selected.

    I have tried this in two forms:

    Repeating table with emails in separate boxes

    One box allowing multiple selections.  

    Both do not work for me.

    Thx for any help.

    Tuesday, October 27, 2015 10:25 PM

Answers

  • Hi,

    I have tested in my environment by following your steps and I got the same result.

    Since the xPath of concat function is based on Eval function, you can type your xPath like this:

    xdMath:Eval(xdMath:Eval(/my:myFields/my:email/my:Change_Implementer_Primary/pc:Person/pc:DisplayName, 'concat(., ";")'), "..")

    or

    xdMath:Eval(xdMath:Eval(/my:myFields/my:email/my:Change_Implementer_Primary/pc:Person, 'concat(./pc:DisplayName, ";")'), "..")

    Then it worked fine.

    If you set xPath of concat function to “/my:myFields/my:email/my:Change_Implementer_Primary/pc:Person/pc:DisplayName”, it will retrieve the first value in Repeating Table.

    Best Regards,

    Dean Wang


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    • Marked as answer by Nexcompac Thursday, October 29, 2015 5:00 PM
    Wednesday, October 28, 2015 9:19 AM

All replies

  • Hi,

    I have tested in my environment by following your steps and I got the same result.

    Since the xPath of concat function is based on Eval function, you can type your xPath like this:

    xdMath:Eval(xdMath:Eval(/my:myFields/my:email/my:Change_Implementer_Primary/pc:Person/pc:DisplayName, 'concat(., ";")'), "..")

    or

    xdMath:Eval(xdMath:Eval(/my:myFields/my:email/my:Change_Implementer_Primary/pc:Person, 'concat(./pc:DisplayName, ";")'), "..")

    Then it worked fine.

    If you set xPath of concat function to “/my:myFields/my:email/my:Change_Implementer_Primary/pc:Person/pc:DisplayName”, it will retrieve the first value in Repeating Table.

    Best Regards,

    Dean Wang


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    • Marked as answer by Nexcompac Thursday, October 29, 2015 5:00 PM
    Wednesday, October 28, 2015 9:19 AM
  • That is exactly what was happening!! Thx so much.

    This was my end two results:

    This one allows me to use your result and grab more than one repeating table.  Perfect!

    concat(eval(eval(DisplayName, 'concat(., ";")'), ".."), eval(eval(DisplayName, 'concat(., ";")'), ".."))

    This on is your solution which populates my CC field.

    eval(eval(DisplayName, 'concat(., ";")'), "..")

    The only other item I find weird is if I use the BCC field, any email included only here, appears blank and from the SharePoint sender not the creator of the InfoPath form.

    Thursday, October 29, 2015 4:50 PM
  • Sole one issue, and another surfaces!

    Now that the emails work sending to the right individuals, some of the content of the email is displaying incorrectly.  The names of the users listed in the form do not show up in the template sent to email as seen before:


    • Edited by Nexcompac Monday, November 2, 2015 5:10 PM
    Thursday, October 29, 2015 10:38 PM
  • I edited my last post to correctly show the image.

    Here is the issue:

    I send the path in email form with multiple emails in the repeating table.  however when the email arrives, the repeating tables are there, but they do not display correctly.  See incorrect below:

    You can see both repeating tables under Change Implementer(s)

    Here you can see how it should appear:

    Monday, November 2, 2015 5:31 PM
  • Hi Nexcompac,

    Did the “Change Implementer” field display null in email after you typed it?

    I have tested in my environment and didn’t reproduce your issue.

    Please check following points:

    1. How did you set value to the people picker control? Typed it manually or use rules? If you used rule, please make sure you have given 3 effective values to DisplayName, AccountId and AccountType fields.

    2. Which option did you select in Data Connection Wizard? "Send only the active view of the form and no attachment" or “Send the form data as an attachment”? Please change option to test whether the issue occurs.

    3. Could the client you use to open the form from email have access to the site you’re given to the People picker control in control properties? I tested it is a client which can access related site, the problem cannot be reproduce there. But I doubt, if a client cannot access the site, will it get value in the people picker control in email attachment?

    4. Or a workaround is to add another text control, set its default value to the DisplayName field of the people picker field, so you can see the value in the text field instead of people picker control.

    Best Regards,

    Dean Wang


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Tuesday, November 3, 2015 6:04 AM
  • I have tested several times since and all the names show up now when using filler to create the form.  I get missing fields when using the browser to populate the form... Dang browsers....

    To answer you above questions:

    1. How did you set value to the people picker control? Typed it manually or use rules? If you used rule, please make sure you have given 3 effective values to DisplayName, AccountId and AccountType fields.

    • I chose the people picker option from the controls section.  It populated the tree in the fields section automatically.

    2. Which option did you select in Data Connection Wizard? "Send only the active view of the form and no attachment" or “Send the form data as an attachment”? Please change option to test whether the issue occurs.

    • Not the Send as attachment option.  I was under the impression that would not display in the email, rather require ppl to open the attachment.  I want the content visible.

    3. Could the client you use to open the form from email have access to the site you’re given to the People picker control in control properties? I tested it is a client which can access related site, the problem cannot be reproduce there. But I doubt, if a client cannot access the site, will it get value in the people picker control in email attachment?

    • I am opening the emails from a workstation on the same corporate network.  I did however try forwarding outside and the names disappeared and there was img attachments on the email.

    4. Or a workaround is to add another text control, set its default value to the DisplayName field of the people picker field, so you can see the value in the text field instead of people picker control.

    • I will have to think about this as an option.  I have never done this, so more advanced than I understand.... else in my head I am making it more difficult than it needs be...

    Wednesday, November 4, 2015 1:17 AM
  • Hi Nexcompac,

    Did the users names display in BCC field in email? If yes, the people picker field should display the same value.

    Where did you open the email? In the browser of in Outlook client application? If in the browser, please try to change another browser to test.

    Best Regards,

    Dean Wang


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Friday, November 6, 2015 2:57 AM