Setting Email rules based on field values - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Setting Email rules based on field values

Last post 12-06-2017 09:58 AM by KTerry. 19 replies.
Page 1 of 2 (20 items) 1 2 Next >
Sort Posts: Previous Next
  • 10-09-2008 07:15 AM

    Setting Email rules based on field values

    Hi all,

     

    I am trying to determine the best way to accomplish the following using InfoPath 2007 and Forms Services.  I have a form that allows a user to select a region.  For instance US and Americas.   If Americas it is submitted to a specific person through email.  If US the same rule applies but a different manager receives the form.  I could have multiple Submits but that would be 5 buttons I believe.  HOw would I go about this without getting heavy into coding? 

    Any assistance much appreeciated.

    Paul 

     

     

  • 10-09-2008 08:48 AM In reply to

    Re: Setting Email rules based on field values

    Hi, and welcome:

    Can you add a field to your data source for the email address for the submit connection? Then you could use a rule on the region to change the value of that field. That way you have one Submit, to email, with the field as the 'To' value.

    Let me know if you need more detail.

    Hilary Stoupa

  • 10-09-2008 09:18 AM In reply to

    Re: Setting Email rules based on field values

    Hilary,

     Thanks for the quick reply.  Being new to InfoPath some detail would be greatly appreciated.   I understand the solution its just getting aclimated with where to do this is a bit challenging.

     

    Paul

     

    Filed under:
  • 10-09-2008 09:39 AM In reply to

    Re: Setting Email rules based on field values

    Sure thing.

    First, add a field to your main data source:

    1. Right click the group you wish to add the field to (probably your top level group) and select Add
    2. Name the field email and say okay (note: if you already have something named email, pick another name, just use the name you pick in the other steps).

    Next, add a rule to the field bound to your control with the regions:

    1. Right click the control.
    2. Select Rules
    3. Add a rule with the condition "Region is equal to Americas"
    4. Add an action to the rule to set the value of your email field to the email address you wish
    5. Repeat -- add another rule with the condition "Region is equal to USA" & set the email field

    Now, create your submit to email data connection.

    1. Select Tools/Data Connections
    2. Select Add
    3. Select Submit
    4. Select As an email message
    5. In the To field, select the fx button
    6. In the formula editor, select Insert field or group
    7. Select your email field, close out of the editor and complete the rest of the information for the email submit.
    Hilary Stoupa

  • 10-09-2008 11:43 AM In reply to

    Re: Setting Email rules based on field values

    Worked like a champ.  One last quick question is what is the best approach hide that column and control from the end user filling out the form?  I obviously need ti include it in the default view as there are rules against it.  I toyed with views but for one column that seems silly.   I thnk the best approach would be to use conditional formatting for the section control but I am with extra space due to the table layout I am using.  The best scenerio is that the business will allow this column and just label it intuitively but we will see.

     

    Thank you all the help.

     

    Paul

  • 10-09-2008 11:51 AM In reply to

    Re: Setting Email rules based on field values

    Ah, you see, the rules aren't set on the control -- they are set on the field that is bound to the control. So if you go to your Data Source Task Pane, and right click on the field that the control is bound to (region, or whatever the name) and select Properties, you'll see a rules tab. Any rules bound to the field will be there.

    I guess my question is if the user isn't selecting a region, how does it get set? Or were you referring to the new email field? Again, you don't have to have a control on your form bound to the field in order for the rules to set the value.

    Hilary Stoupa

  • 10-09-2008 12:04 PM In reply to

    Re: Setting Email rules based on field values

    I am referring to the new email field.  So your saying I can unbind the control and still should be ok?  What a learning experience :)

     

     

  • 10-09-2008 01:02 PM In reply to

    Re: Setting Email rules based on field values

    You can delete the control and will still be okay.

    Here's a great way to test -- when you submit the form, you get a pop up asking about sending an email. Delete the control bound to email and then select a region and select submit. Notice who the email is 'To' and cancel out of the submit. Change regions and try again. Because it isn't a control you are setting a value with in your rule, it is a field. Some things in InfoPath are related to a control, some to a field. Conditional formatting? That's related to a control. Rules? Related to fields.

    Hilary Stoupa

  • 10-10-2008 07:08 AM In reply to

    Re: Setting Email rules based on field values

    Worked Great.  Again, thanks for all the help

  • 11-24-2008 09:38 AM In reply to

    • SoniaC
    • Not Ranked
    • Joined on 11-24-2008
    • Posts 3

    Re: Setting Email rules based on field values

    Hilary,

     I am also new to InfoPath and I used your instructions to set the option to send emails to various people based on rules.  Example:  region_dept = Southwest.  The region_dept field is a drop down box that the user will select from.  Based on their selection, it will emial a specific person which I set up in a rule.  Once they fill out the form, they submit to a database.  I have a couple questions.  The email address in the rule is in quotes, is that correct?  Example:  smithsonia@abc.com.  My emali is not being sent.  I would like the email to be sent after they click the submit to database button.  Is this possible?  I really appreciate your help.

  • 11-24-2008 09:51 AM In reply to

    Re: Setting Email rules based on field values

    Hi, and welcome:

    When you create a rule, one possible action is to set a field's value. When you do that, if you don't select the fx button to type in the formula box, you can just enter text, no quotes. If you are in the formula editor, you'll need to use quotes. I'm not sure if that answers your question or not! :)

    When you say your email is not being sent, do you get the popup that shows the values for the email? Does the email address have quotes around it? You don't want that...

     

    Hilary Stoupa

  • 11-24-2008 10:08 AM In reply to

    • SoniaC
    • Not Ranked
    • Joined on 11-24-2008
    • Posts 3

    Re: Setting Email rules based on field values

    If I look at the email address where you enter text it does not have quotes.  If I click the fx button it shows the quotes.  It shows under actions as =fxSet a field's value: email1=smithnancy@abc.com

    I do not get the popup and I put my email in as the email address to see if I receive it and I do not.

     

  • 11-24-2008 11:18 AM In reply to

    Re: Setting Email rules based on field values

    Did you set up an email submit connection in your form? Is it part of your submit rules or being used by the form on submit? If you aren't getting a pop-up showing info about the outgoing email and asking if you want to send it, then there is a problem with your email submit, not the address....

    Hilary Stoupa

  • 11-24-2008 11:36 AM In reply to

    • SoniaC
    • Not Ranked
    • Joined on 11-24-2008
    • Posts 3

    Re: Setting Email rules based on field values

    Thank you so much for your help.  Everything is working great!

  • 03-05-2010 07:50 AM In reply to

    Re: Setting Email rules based on field values

    Hi Hilary, a bit of quick query for you but it's along the same lines as this thread.  I currently have a form I've set up with a submit to email data connection.  The data connection is tied to an email address field which changes based on another selection within the form (so far, so easy!)

    The problem I'm encountering is that although the form submits fine to email for most users, we have a handful of users who are still using IP 2003.  The form has been created in 2007 but has been designed to be 2003 compatible etc.  When a user who's on IP 2003 tries to submit the form, they're getting an error message that the form can't be submitted as Outlook 2007 is not the default email client!  I've looked all through every setting I can think of and can't see anywhere that dictates which email client must be used and can't figure out why this is happening....

    Unfortunately there's no scope to get these users onto IP 2007 at the moment and this rather simple form now has me banging my head against a wall...any thoughts?

    Ben

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