Repeating Contact Selector - Email on check of notify field - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Repeating Contact Selector - Email on check of notify field

Last post 09-21-2011 07:15 AM by Big E. 14 replies.
Page 1 of 1 (15 items)
Sort Posts: Previous Next
  • 08-23-2011 11:13 AM

    • Big E
    • Top 500 Contributor
      Male
    • Joined on 02-18-2009
    • Alabama
    • Posts 35

    Repeating Contact Selector - Email on check of notify field

    I have a contact selector in a repeating section.  This works fine.  In the datasource, I added a "notify" checkbox under the top level group of the contact selector.  The reason behind this is so that I would have a checkbox for each contact selector value.

    What I would like to have is an email that can be sent to the contact selector that has a check next to it.  I'm at a loss on this one.  I am able to do this for one selector but when it comes down to two, it just isn't working.

    Thanks,
    Eric

  • 08-29-2011 10:42 AM In reply to

    Re: Repeating Contact Selector - Email on check of notify field

    Hi - You'll need to use a double eval formula with an XPath filter to select only the items where the field bound to your checkbox is equal to true. For the basics on the double eval: http://blogs.msdn.com/b/infopath/archive/2006/04/05/569338.aspx

    After you have your double eval formula, you can manually add an XPath filter to select just the fields where the checkbox is true.

    Hilary Stoupa

  • 09-01-2011 08:15 AM In reply to

    • Big E
    • Top 500 Contributor
      Male
    • Joined on 02-18-2009
    • Alabama
    • Posts 35

    Re: Repeating Contact Selector - Email on check of notify field

     Thanks for the response Hilary.  I tried by using the following formula but no values are returned to the "CombinedAssignedToEmail" field that should be populated when the rule from the "Notify" checkbox is fired:

     xdMath:Eval(xdMath:Eval(../my:Person, 'substring(concat(my:AccountId, ";"), 1, (my:Notify = string(true())) * string-length(concat(my:AccountId, ";")))'), "..")

     My structure is as follows:

    Notify - checkbox (true/false boolean) under the main repeating group that the contact selector resides

    ContactSelector

    Person (Repeating)
    DisplayName
    AccountId
    AccountType

     

  • 09-01-2011 08:30 AM In reply to

    Re: Repeating Contact Selector - Email on check of notify field

    Where in your data structure is the CombinedAssignedToEmail?

    Can you attach a screenshot of your main data source?

    Hilary Stoupa

  • 09-01-2011 08:40 AM In reply to

    • Big E
    • Top 500 Contributor
      Male
    • Joined on 02-18-2009
    • Alabama
    • Posts 35

    Re: Repeating Contact Selector - Email on check of notify field

    Datasource

  • 09-01-2011 09:59 AM In reply to

    Re: Repeating Contact Selector - Email on check of notify field

    Hi Big E,

    Can you move CombinedAssignedToEmail up above the repeating ProjectTask group? Just click the dropdown and move up. Hopefully you don't have a lot of data saved already since this will change the structure of your data source.

    Cheers,

    Patrick Halstead
    Project Manager at Qdabra
  • 09-01-2011 10:54 AM In reply to

    • Big E
    • Top 500 Contributor
      Male
    • Joined on 02-18-2009
    • Alabama
    • Posts 35

    Re: Repeating Contact Selector - Email on check of notify field

    I moved the field but the CombinedAssignedToEmail field still does not get populated when I click the checkbox.

  • 09-01-2011 10:57 AM In reply to

    Re: Repeating Contact Selector - Email on check of notify field

    Sorry to imply that my suggestion would do that.

    I just saw your data source and my quick-draw response was - "oh, there's a problem with his data source!". In general, fields should never come after repeating groups since it will be very difficult to access them via rules, etc.

    Now that you've changed it, can you recreate your rule to set it? Or did you do that already?

    Patrick Halstead
    Project Manager at Qdabra
  • 09-01-2011 11:05 AM In reply to

    • Big E
    • Top 500 Contributor
      Male
    • Joined on 02-18-2009
    • Alabama
    • Posts 35

    Re: Repeating Contact Selector - Email on check of notify field

    I recreated the rule but it still does not work.  Not sure why this rule would not fire.

  • 09-01-2011 11:58 AM In reply to

    Re: Repeating Contact Selector - Email on check of notify field

    Sorry to be slow to get back to this.

    First off, I'd suggest a default value in your field that is meant to hold the concatenated email addresses.

    Second off, I'd try again to set the formula up, without bothering with the rather complex logic you are using to try to exclude items where notify is not clicked - that can be added later.

    Be sure you pick the Person field using the Insert Field or Group button, then just follow the IP team blog post for the rest of the formula. With your deeply nested repeating structure, I'm not sure if double eval is going to work, but I'd definitely start with the basics. If I get a chance later today, I'll set up a sample form.

     

    Hilary Stoupa

  • 09-01-2011 05:40 PM In reply to

    Re: Repeating Contact Selector - Email on check of notify field

    So, here's a sample of what I mean. Right click the link in the post heading, and you can save it locally. Then right click on the saved file and open in design mode - from there you can resave or preview or what have you. Pardon the fact that I didn't include an actual Contact Selector - my VM with IP 2007 is off right now - but I just replicated the schema for it. There is a default value on the field called "Email" that only gets the account Ids from the innermost repeating group (you'll have to excuse the fact that I didn't name my fields nicely - usually I kind of get scoldy with people about that).

    Hilary Stoupa

  • 09-02-2011 06:45 AM In reply to

    • Big E
    • Top 500 Contributor
      Male
    • Joined on 02-18-2009
    • Alabama
    • Posts 35

    Re: Repeating Contact Selector - Email on check of notify field

    I was able to recreate using your example.  I also noticed that I was doing something wrong.  Instead of filtering on the contact selector where notify = true, I was typing it in.  This is the formula I used and everything seems to be working fine except for one thing. I designed the form in InfoPath 2007 and had to run a repair on 2010 so that I could open your file.  After that, I had to run another repair to use InfoPath 2007 again.  Now, the form will not open in preview mode.  It publishes just fine.  Any thoughts?

     eval(eval(Person[Notify = string(true())], 'concat(my:AccountId, ";")'), "..")

  • 09-02-2011 09:06 AM In reply to

    Re: Repeating Contact Selector - Email on check of notify field

    If you try to open the template, rather than preview it, sometimes it will error and give you a better message (sorry about the 2010 thing - I thought I saved it as 2007!)

    What error are you getting when you try to preview?

    Hilary Stoupa

  • 09-06-2011 10:44 AM In reply to

    • Big E
    • Top 500 Contributor
      Male
    • Joined on 02-18-2009
    • Alabama
    • Posts 35

    Re: Repeating Contact Selector - Email on check of notify field

     Sorry about not getting back with you sooner on this.  It says, "InfoPath cannot open the selected form"

  • 09-21-2011 07:15 AM In reply to

    • Big E
    • Top 500 Contributor
      Male
    • Joined on 02-18-2009
    • Alabama
    • Posts 35

    Re: Repeating Contact Selector - Email on check of notify field

    I think I know what is causing this issue.  It started after I put in the fix for this.  Something with the double eval formula is causing an error.  It's ok.  I can work without previewing this.

    Thanks for all the help.

    -Eric

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