ISO: techniques to generate dynamic mail addresses before sending an infopath form - InfoPath Dev
in

InfoPath Dev

ISO: techniques to generate dynamic mail addresses before sending an infopath form

Last post 06-17-2009 07:09 AM by warrtalon. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 06-16-2009 07:05 AM

    ISO: techniques to generate dynamic mail addresses before sending an infopath form

    Hello.

     I am looking at the requirements for a specific browser based application that seems fit for an infopath form, with one twist.

    The requirements are to generate a request for information. The user supplies their name and a few other relevant items. Then they select one or more of 25 different checkboxes, indicating information of interest.

    With each checkbox, there are one or more mail addresses associated.

    The goal is to generate an information request email based on all the information (including checkboxes) that the user selected. This one summary request is then sent to the list of addresses specified by the checkboxes.

     I've written two simple InfoPath forms to date, but I have not found in the documentation a way to tie mail addresses to checkboxes, and then include only those mail addresses to the mail being sent through the data connection.

     I would really appreciate pointers to relevant discussions, blugs, books, or other ways to learn how to create such functionality.

     

    Thank you very much.

    http://wiki.tcl.tk/
  • 06-16-2009 08:37 AM In reply to

    Re: ISO: techniques to generate dynamic mail addresses before sending an infopath form

    I believe this is all possible via rules. Let's say I have two checkboxes and two fields that contain emails. If the user checks Checkbox A, email is sent to Email 1. If the user checks Checkbox B, email is sent to Email 2. Rules will allow you to execute different actions according to what the user checked. But the key here is that the data connection wizard allows you to use a field as your To: , CC: and Bcc: recipients, so you need to make sure that, via rules, you populate that field correctly.

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


  • 06-16-2009 10:16 AM In reply to

    Re: ISO: techniques to generate dynamic mail addresses before sending an infopath form

    Thank you for your suggestion. I guess I don't know that I've learned how to do that sort of thing via rules yet. I would need 25 rules, I guess, each appending onto the end of either the To or Cc fields.

    Does the Data Connection have a limit to the number of users in a To or Cc list?

    Do you know of any examples that demonstrate this technique?

    Thank you again for your suggestion.

     

    http://wiki.tcl.tk/
  • 06-16-2009 12:10 PM In reply to

    Re: ISO: techniques to generate dynamic mail addresses before sending an infopath form

    I don't have a working example, sorry.

    Let's use the example of two checkboxes and I'll let you extrapolate.

    • If I check Checkbox 1, a rule sets my:EmailTo equal to Email 1.
    • If I check Checkbox 2, a rule sets my:EmailTo equal to Email 2.

    The data connection to submit via email is set the To: field of the email equal to the contents of the my:EmailTo field.

    So you're not manipulating the Data Connection itself; you're manipulating the value of the field (my:EmailTo) that the data connection uses.

    Does that make sense?

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


  • 06-16-2009 12:30 PM In reply to

    Re: ISO: techniques to generate dynamic mail addresses before sending an infopath form

    I do understand what you are saying.

    My need, however, is a bit more complex than this. In my case, with 25 checkboxes, a user will frequently be checking more than 1 - and may at times be selecting a dozen or more. Some how, the rules are going to need to append to my:EmailTo rather than add to it. But the InfoPath 2007 Rules for submit seemed to only set fields, rather than append to fields.

    Is there some way to cleverly change the setting of the field into an append operation, or perhaps concatenate to the existing value a new value?

     Thank you for your patience.

    http://wiki.tcl.tk/
  • 06-16-2009 08:32 PM In reply to

    Re: ISO: techniques to generate dynamic mail addresses before sending an infopath form

    Look at this template, and see if it works for you.  Here are the quick hits:

    1) I have the checkboxes as text fields instead of boolean.  Cleared is Null, and Checked is the Email Address of the relevant user.  If there is more than one user per checkbox, then separate them by semicolons for the Checked value.

    2) An EmailTo field with a default value of all the check box field concatenated and delimited by semicolons

    3) In the Email data connection (assuming that's what you're using), you email to the field EmailTo, which will contain all relevant email addresses.

  • 06-17-2009 04:26 AM In reply to

    Re: ISO: techniques to generate dynamic mail addresses before sending an infopath form

    I understand. I actually recently implemented something similar. I distilled my form to just show what you need. See attached.

    Though the response above is very good too. I think you'll have enough now to come up with a good solution. Good luck!

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


  • 06-17-2009 04:36 AM In reply to

    Re: ISO: techniques to generate dynamic mail addresses before sending an infopath form

    Thank you so much for taking time to work up this example. That is an interesting idea that I will see if I can make use of.

    http://wiki.tcl.tk/
  • 06-17-2009 04:37 AM In reply to

    Re: ISO: techniques to generate dynamic mail addresses before sending an infopath form

    Thanks for the example. I'll see what seems to work best for me.

    http://wiki.tcl.tk/
  • 06-17-2009 06:53 AM In reply to

    Re: ISO: techniques to generate dynamic mail addresses before sending an infopath form

    Thank you so much for all your help. I hope you don't mind a few related questions.

     In your example, you show me 3 checkboxes, each with a unique text value. Then there is a text field that uses a concat function to concatenate the text fields, separated by a semicolon.

    Since I don't want the real application to display the actual addresses to the user, I should be able to create th holding field, then delete the actual display control from my form, right? There won't be some side effect of removing the visual cue to cause this to fail, right? The user won't see this specific email, so they won't see the addresses that way.

     Also, are there any limits to the number of addresses that I can supply to the data connection in this fashion? My application will have 25 check boxes, some of which will have 2 or 3 addresses listed.

     

    http://wiki.tcl.tk/
  • 06-17-2009 07:09 AM In reply to

    Re: ISO: techniques to generate dynamic mail addresses before sending an infopath form

    1) Certainly.  In fact, the holding field (EmailTo) never has to be on the canvas.  I just put it there to show you what's happening, and I always put things like that on my canvas during testing so that I can make sure it's working in preview mode.  Absolutely no effect to not putting a control on the canvas.  I make forms with LOTS of hidden fields.  Remember that your fields are just data elements in the data source.  They can be empty and never used, or they can be full of data but never seen.  Controls are nothing more than display mechanisms for data fields, and you don't have to show fields if you don't want to.

    2) There should be no limit, because InfoPath and SharePoint don't really know or care what you're doing.  All InfoPath knows is that you are send an email to a data field.  That data field happens to have a ton of email addresses delimited by semicolons, which is what is recognized as the proper separator between email addresses in this case.

    Go try it and see if it works...

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