Autopopulate email subject line - InfoPath Dev Sign in | Join | Help in Newbie Questions InfoPath (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads InfoPath Dev » InfoPath » Newbie Questions » Autopopulate email subject line Autopopulate email subject line Last post 09-29-2013 08:04 PM by donstephen. 37 replies. Page 1 of 3 (38 items) 1 2 3 Next > Sort Posts: Oldest to newest Newest to oldest Previous Next 08-04-2013 11:54 AM remigiuszmarian Joined on 08-04-2013 Posts 19 Autopopulate email subject line Reply Contact HI,I am very new to InfoPath 2010 but I have been able to create a form and setup a few very minor things such as, hide a drop down list when the check box associated with it is not selected...I am new to InfoPath 2010 and I am incorporating it with SharePoint Server 2013. My organization has asked that I try to create a form that will be available in SharePoint. For this purpose I have setup a form library in SharePoint. The form library will hold a form that is designed for filling out information related to computer setup. I have a section on the form that I called: Distribution and it contains 4 check boxes: 1.Keep on hold until claimed, 2.Transfer to:, 3.Keep in inventory for, and 4. Surplus.Check box 2 and 3 have an associated drop down list which lists the departments that we service. And when I mean associated I mean that I have set the drop down list to be invisible unless the check box is checked. What I would like to do is setup the form so that, 1. when it is submitted by a user it will create an email by auto populating the subject line with the name of the checked distribution check box and the field that was selected in the drop down list, and then emailed to a user. And 2, I would like the form to be also submitted to the SharePoint form library and saved with a name that is auto populated. The auto populated name would need to include the name of the distribution check box that is checked, the department name selected from its drop down list, and the date of the submission.From my understanding the form can be submitted to the form library and be viewable and searchable as well as when it is filled out it can be saved into the Form Library. Can I also get some help on how to set this up? I am very new to this and I would appreciate any help that I can get. Not much coding experience here. Thank you Filed under: form library, info path 2010, save filled out form in form library, Email subject line, autopopulate email subject line, submitting a form 08-04-2013 09:15 PM In reply to donstephen Joined on 05-19-2013 Posts 623 Re: Autopopulate email subject line Mark as Not AnswerMark as Answer... Reply Contact Hi remigiuszmarian, To my understanding, you would like to populate the e-mail subject line with the selected check box and drop-down list value, and second, submit the form to a SharePoint Library with a form name using values selected from another check box and drop down list. For the first one, assuming that you already have a field and a SharePoint Library column for the e-mail subject line, I would suggest adding a rule to the drop down list that runs on the condition that the drop down field is not blank. Select the e-mail subject line field as the target field for the rule. For the value, click fx, then use a concat formula to combine the title and department. Example: concat("Whichever title you want to put for the selected check box", " - ", dropdownfield) Note that we are using the drop down list control to populate the E-mail Subject Line when we select a value for the drop down list. The first line is a text entry for the check box title. The dash will separate the check box title from the drop down list value. Then insert the specific drop-down list field so that the value will change depending on the value selected. The second concern holds the same concept. Add another rule that sets a fields value to another field which will contain the form's name. To add a date, insert a function "today()" to the concat formula.concat("Distribution check box", " - ", dropdownfield, " - ", today()) Let us know if it helps. Cheers! Don Stephen Lambatin / Support Engineer Qdabra Software 08-04-2013 10:27 PM In reply to remigiuszmarian Joined on 08-04-2013 Posts 19 Re: Autopopulate email subject line Mark as Not AnswerMark as Answer... Reply Contact Hi donstephen,Thank you for your suggestions and examples. I will try them today and see how they work out. Also, you mentioned, " For the first one, assuming that you already have a field and a SharePoint Library column for the e-mail subject line," what do you mean by a field and a SharePoint Library column for the email subject line? Could you please explain this to me further? Regarding the 2nd formula: will I need to add this formula to the submit button that I have added to the form? Or, will I need to add it also to the drop down list? How will I add the 2nd formula so that it will be in effect when saving the form? Thanks! 08-05-2013 12:08 AM In reply to donstephen Joined on 05-19-2013 Posts 623 Re: Autopopulate email subject line E-mail Subject Line & Form Name.xsn Mark as Not AnswerMark as Answer... Reply Contact Apologies for the confusion, kindly disregard library column as it was intended for another function. The field would instead be hidden from the canvas, and will contain the line intended for the subject when you insert the field at the E-mail Data Connection Wizard (select fx to insert the field). For the 2nd formula, since there would be several check boxes and a corresponding drop-down for each check box, it would be confusing and complicated if all the rules for naming the form would be placed on just one submit button, and each action rule would need to meet a certain condition before it runs. Using the drop-down control to trigger the Form Name value is a lot more simple and less complicated. I'm attaching a form which you could use for reference. Don Stephen Lambatin / Support Engineer Qdabra Software 08-05-2013 01:20 PM In reply to remigiuszmarian Joined on 08-04-2013 Posts 19 Re: Autopopulate email subject line Mark as Not AnswerMark as Answer... Reply Contact When I enter the fx in order to create the formula for the email I receive the following error message after verifying the formula: "DistributionTransferCheckboxDropdownList" does not point to a valid location path of a field or group. Can you tell me what I am doing wrong? I created a section at the bottom of the form in which I added a text field called "E-mail Subject." I right clicked on the field and accessed the "Text Box Properties..." option where I clicked on "Fx" and entered concat("DistributionTransferToCheckbox", " - ", DistirbutionTransferToCheckboxDropdownList) which returned with the above error.Can I attach the form so that you can see what I have? 08-05-2013 05:44 PM In reply to donstephen Joined on 05-19-2013 Posts 623 Re: Autopopulate email subject line Mark as Not AnswerMark as Answer... Reply Contact For the DistirbutionTransferToCheckboxDropdownList, you would need to insert the drop down field by: 1. Highlighting DistirbutionTransferToCheckboxDropdownList2. Clicking the "Insert Field or Group" button3. Selecting the designated drop down-field from the schema After inserting the field, it should turn into an underlined period, and your formula should somehow look like this: concat("DistributionTransferToCheckbox", " - ", .) Also, DistributionTransferToCheckbox could have spaces in between. This particular text will appear exactly as how it was written on the formula at the E-mail Subject Line. If that doesn't work, please feel free to attach your form so we could see what's missing. Don Stephen Lambatin / Support Engineer Qdabra Software 08-07-2013 08:05 AM In reply to remigiuszmarian Joined on 08-04-2013 Posts 19 Re: Autopopulate email subject line Computer Setup Form.xsn Mark as Not AnswerMark as Answer... Reply Contact Hi donstephen,I followed your instructions but I have a few things happening that should not be. For example, when I preview the form, the name of the check box is already present in the E-mail and Form Name lines. It looks like this when I preview the form and select a value from the drop down list: DistributionTransferToCheckbox - Civil and Environmental and DistributionTransferToCheckbox - Civil and Environmental - 2013-08-07. I do not know what I am doing wrong... I am thinking that maybe this is happening because my form is not setup correctly? I am attaching the form for you to take a look at. Also, I would like to know what type of formula I will need to use in order for the E-mail subject line to be populated with which ever Distribution check box is checked. I assume that I would use the same formula for setting the form name, correct?Do I need to have an E-mail checkbox in order for an email to be sent? What if I would like the form to be emailed automatically to two individuals once it is submitted to the SharePoint Form Library? 08-07-2013 08:28 PM In reply to donstephen Joined on 05-19-2013 Posts 623 Re: Autopopulate email subject line Computer Setup Form.xsn Mark as Not AnswerMark as Answer... Reply Contact Hi remigiuszmarian, I was able to check your form and it seems that you have added that formula to the E-mailSubject field. Please check the changes I made to your form and see if the E-mail Subject Line changes whenever a Distribution has been selected. Regarding the e-mail configuration, proceed to Data Connections under the Data Tab and modify the Send Email connection settings to add recipients, subject line, etc.. And an Action Rule to the submit button that Submits Data, and choose the Send Email data connection you have just configured. Hope this helps. Don Stephen Lambatin / Support Engineer Qdabra Software 08-08-2013 12:24 PM In reply to remigiuszmarian Joined on 08-04-2013 Posts 19 Re: Autopopulate email subject line Mark as Not AnswerMark as Answer... Reply Contact Hi donstephen, I can now see where I was making my mistakes. Thank you for the corrections that you made. I have setup the form and sent a test email to myself. I received the email but noticed that the alignment of certain fields is off, I will make the alignment corrections. They are not your fault, lol. Besides that, the form looks good regarding the email part. I noticed that when setting up the data connection for the email I can only setup the form to be sent via email or to be submitted to the SharePoint library. Is there a way that I can set the form up so that it also sends the saved form to the SharePoint Form Library? 08-08-2013 08:31 PM In reply to donstephen Joined on 05-19-2013 Posts 623 Re: Autopopulate email subject line Mark as Not AnswerMark as Answer... Reply Contact Hi remigiuszmarian, I'm glad to hear that. For the alignment, I suggest inserting the fields and texts insinde a Custom Table. This would make your form look neat and tidy. As for sending e-mail and submitting to a library, yes it is possible to perform both actions. You may do this by setting the button action at the button properties to Rules and Custom Code. Add a rule to the button that submits data via E-mail, and another rule that submits data to a SharePoint Library. Please see the image below: Don Stephen Lambatin / Support Engineer Qdabra Software 08-12-2013 07:32 AM In reply to remigiuszmarian Joined on 08-04-2013 Posts 19 Re: Autopopulate email subject line Mark as Not AnswerMark as Answer... Reply Contact Hi donstephen, So I have added a 2nd rule to the submit button which will submit the form to the form library. I do have a question regarding the form displaying in SharePoint though. I have tested the same form to see if it would submit to the Form Library in SharePoint but it didn't appear in the form library. So my question is, when entering the document library location in the Data Connection Wizard, am I to enter the web address of the form library? For example, would I enter: http://mysharepoint/departments/ecs/nameofformlibrary? Or can I just copy the link that appears in the address bar when accessing the form library, and paste it into the Data Connection Wizard? Also, do I need to first upload a form template and make it the default for my form library or will it become the default template once it is uploaded? How would I go about doing this? Another scenario, since I tested the publishing of the form before it was completely edited, InfoPath Design is now always looking at the form library to which I published the form to. Since then I have deleted that form library but I have no idea how to change the publish to location. I can't seem to find a way to change the publish location for the form library, as if once a publish location has been set it cannot be changed. How can I change the publish location? I know that I can create a new form library location during the publishing of the form by going to File>Publish>SharePoint Server> and following the instructions, will I be able to create a new publish location or at least update the old one? It seems to me that once I have published a form to the publish location, even though it has been deleted, it cannot be changed. Please correct me if I am wrong. 08-13-2013 04:27 AM In reply to donstephen Joined on 05-19-2013 Posts 623 Re: Autopopulate email subject line Mark as Not AnswerMark as Answer... Reply Contact Hi remigiuszmarian, Yes, you would need to use the exact library location at the Data Connection Wizard. It is actually the link located at the URL but will have extra strings, so you would need to remove those. Example: http://<mysharepoint>/<mysite>/<myformname>/Forms/AllItems.aspx So you should only use http://<mysharepoint>/<mysite>/<myformname>/ When you publish a form, it automatically becomes the default template, whether the library already exists or not. Also, if you decide to publish the form without a pre-created library, you will be prompted for an option to update an existing library or create a new one at the Publishing Wizard. Lastly, re-publishing a form. Go to File>Publish>SharePoint Server. When prompted for a SharePoint site, enter a new site URL ( http://<myserver>/<mysite>/ ) (see image below). This allows you to change the library location, and you can also re-use the same server. Simply select Create a new form library in order to use a new library (see image above). Hope this helps. Don Stephen Lambatin / Support Engineer Qdabra Software 08-13-2013 06:40 AM In reply to remigiuszmarian Joined on 08-04-2013 Posts 19 Re: Autopopulate email subject line Form Lib.jpg Mark as Not AnswerMark as Answer... Reply Contact Thanks for that donstephen. I am glad that I had the right thought process about this. I have uploaded the form and when I access the form library I do not see the form. This is what I see: Is there something that I am doing wrong? Wouldn't I see the form listed in this space? When I published the form I had it create a new form library to which the form was published but it does not display it in there. Am I missing some steps? 08-14-2013 11:05 PM In reply to donstephen Joined on 05-19-2013 Posts 623 Re: Autopopulate email subject line Mark as Not AnswerMark as Answer... Reply Contact You're welcome remigiuszmarian. Regarding the image, you would need to click on "new document" to add a form, but I am guessing that what you want on this page is the view of the form itself. For that, you would need to create or add a web part, and you would need to configure the page to the way you want it presented. Hope this helps. Don Stephen Lambatin / Support Engineer Qdabra Software 08-15-2013 06:29 AM In reply to remigiuszmarian Joined on 08-04-2013 Posts 19 Re: Autopopulate email subject line Mark as Not AnswerMark as Answer... Reply Contact donstephen, I would like for the user to be able to click on "New Document" and have the form appear. This did not happen after I clicked the "New Document" option. How would I go about resolving this? I think that it might be something to do with the form settings but I am not entirely sure if the security and trust area is where I should look (in the form options) or should I be looking somewhere else. Page 1 of 3 (38 items) 1 2 3 Next > Copyright © 2003-2019 Qdabra Software. All rights reserved.View our Terms of Use.
HI,
I am very new to InfoPath 2010 but I have been able to create a form and setup a few very minor things such as, hide a drop down list when the check box associated with it is not selected...I am new to InfoPath 2010 and I am incorporating it with SharePoint Server 2013. My organization has asked that I try to create a form that will be available in SharePoint. For this purpose I have setup a form library in SharePoint. The form library will hold a form that is designed for filling out information related to computer setup. I have a section on the form that I called: Distribution and it contains 4 check boxes: 1.Keep on hold until claimed, 2.Transfer to:, 3.Keep in inventory for, and 4. Surplus.
Check box 2 and 3 have an associated drop down list which lists the departments that we service. And when I mean associated I mean that I have set the drop down list to be invisible unless the check box is checked. What I would like to do is setup the form so that, 1. when it is submitted by a user it will create an email by auto populating the subject line with the name of the checked distribution check box and the field that was selected in the drop down list, and then emailed to a user. And 2, I would like the form to be also submitted to the SharePoint form library and saved with a name that is auto populated. The auto populated name would need to include the name of the distribution check box that is checked, the department name selected from its drop down list, and the date of the submission.
From my understanding the form can be submitted to the form library and be viewable and searchable as well as when it is filled out it can be saved into the Form Library. Can I also get some help on how to set this up?
I am very new to this and I would appreciate any help that I can get. Not much coding experience here.
Thank you
Hi remigiuszmarian,
To my understanding, you would like to populate the e-mail subject line with the selected check box and drop-down list value, and second, submit the form to a SharePoint Library with a form name using values selected from another check box and drop down list.
For the first one, assuming that you already have a field and a SharePoint Library column for the e-mail subject line, I would suggest adding a rule to the drop down list that runs on the condition that the drop down field is not blank. Select the e-mail subject line field as the target field for the rule. For the value, click fx, then use a concat formula to combine the title and department.
Example:
concat("Whichever title you want to put for the selected check box", " - ", dropdownfield)
Note that we are using the drop down list control to populate the E-mail Subject Line when we select a value for the drop down list. The first line is a text entry for the check box title. The dash will separate the check box title from the drop down list value. Then insert the specific drop-down list field so that the value will change depending on the value selected.
The second concern holds the same concept. Add another rule that sets a fields value to another field which will contain the form's name. To add a date, insert a function "today()" to the concat formula.concat("Distribution check box", " - ", dropdownfield, " - ", today())
Let us know if it helps. Cheers!
Hi donstephen,
Thank you for your suggestions and examples. I will try them today and see how they work out. Also, you mentioned, " For the first one, assuming that you already have a field and a SharePoint Library column for the e-mail subject line," what do you mean by a field and a SharePoint Library column for the email subject line? Could you please explain this to me further?
Regarding the 2nd formula: will I need to add this formula to the submit button that I have added to the form? Or, will I need to add it also to the drop down list? How will I add the 2nd formula so that it will be in effect when saving the form?
Thanks!
Apologies for the confusion, kindly disregard library column as it was intended for another function. The field would instead be hidden from the canvas, and will contain the line intended for the subject when you insert the field at the E-mail Data Connection Wizard (select fx to insert the field).
For the 2nd formula, since there would be several check boxes and a corresponding drop-down for each check box, it would be confusing and complicated if all the rules for naming the form would be placed on just one submit button, and each action rule would need to meet a certain condition before it runs. Using the drop-down control to trigger the Form Name value is a lot more simple and less complicated. I'm attaching a form which you could use for reference.
When I enter the fx in order to create the formula for the email I receive the following error message after verifying the formula: "DistributionTransferCheckboxDropdownList" does not point to a valid location path of a field or group. Can you tell me what I am doing wrong?
I created a section at the bottom of the form in which I added a text field called "E-mail Subject." I right clicked on the field and accessed the "Text Box Properties..." option where I clicked on "Fx" and entered concat("DistributionTransferToCheckbox", " - ", DistirbutionTransferToCheckboxDropdownList) which returned with the above error.
Can I attach the form so that you can see what I have?
For the DistirbutionTransferToCheckboxDropdownList, you would need to insert the drop down field by:
1. Highlighting DistirbutionTransferToCheckboxDropdownList2. Clicking the "Insert Field or Group" button3. Selecting the designated drop down-field from the schema
After inserting the field, it should turn into an underlined period, and your formula should somehow look like this:
concat("DistributionTransferToCheckbox", " - ", .)
Also, DistributionTransferToCheckbox could have spaces in between. This particular text will appear exactly as how it was written on the formula at the E-mail Subject Line.
If that doesn't work, please feel free to attach your form so we could see what's missing.
I followed your instructions but I have a few things happening that should not be. For example, when I preview the form, the name of the check box is already present in the E-mail and Form Name lines. It looks like this when I preview the form and select a value from the drop down list: DistributionTransferToCheckbox - Civil and Environmental and DistributionTransferToCheckbox - Civil and Environmental - 2013-08-07. I do not know what I am doing wrong... I am thinking that maybe this is happening because my form is not setup correctly?
I am attaching the form for you to take a look at. Also, I would like to know what type of formula I will need to use in order for the E-mail subject line to be populated with which ever Distribution check box is checked. I assume that I would use the same formula for setting the form name, correct?
Do I need to have an E-mail checkbox in order for an email to be sent? What if I would like the form to be emailed automatically to two individuals once it is submitted to the SharePoint Form Library?
I was able to check your form and it seems that you have added that formula to the E-mailSubject field. Please check the changes I made to your form and see if the E-mail Subject Line changes whenever a Distribution has been selected.
Regarding the e-mail configuration, proceed to Data Connections under the Data Tab and modify the Send Email connection settings to add recipients, subject line, etc.. And an Action Rule to the submit button that Submits Data, and choose the Send Email data connection you have just configured.
Hope this helps.
I can now see where I was making my mistakes. Thank you for the corrections that you made. I have setup the form and sent a test email to myself. I received the email but noticed that the alignment of certain fields is off, I will make the alignment corrections. They are not your fault, lol. Besides that, the form looks good regarding the email part. I noticed that when setting up the data connection for the email I can only setup the form to be sent via email or to be submitted to the SharePoint library. Is there a way that I can set the form up so that it also sends the saved form to the SharePoint Form Library?
I'm glad to hear that. For the alignment, I suggest inserting the fields and texts insinde a Custom Table. This would make your form look neat and tidy. As for sending e-mail and submitting to a library, yes it is possible to perform both actions. You may do this by setting the button action at the button properties to Rules and Custom Code. Add a rule to the button that submits data via E-mail, and another rule that submits data to a SharePoint Library. Please see the image below:
So I have added a 2nd rule to the submit button which will submit the form to the form library. I do have a question regarding the form displaying in SharePoint though. I have tested the same form to see if it would submit to the Form Library in SharePoint but it didn't appear in the form library. So my question is, when entering the document library location in the Data Connection Wizard, am I to enter the web address of the form library? For example, would I enter: http://mysharepoint/departments/ecs/nameofformlibrary? Or can I just copy the link that appears in the address bar when accessing the form library, and paste it into the Data Connection Wizard?
Also, do I need to first upload a form template and make it the default for my form library or will it become the default template once it is uploaded? How would I go about doing this?
Another scenario, since I tested the publishing of the form before it was completely edited, InfoPath Design is now always looking at the form library to which I published the form to. Since then I have deleted that form library but I have no idea how to change the publish to location. I can't seem to find a way to change the publish location for the form library, as if once a publish location has been set it cannot be changed. How can I change the publish location? I know that I can create a new form library location during the publishing of the form by going to File>Publish>SharePoint Server> and following the instructions, will I be able to create a new publish location or at least update the old one? It seems to me that once I have published a form to the publish location, even though it has been deleted, it cannot be changed. Please correct me if I am wrong.
Yes, you would need to use the exact library location at the Data Connection Wizard. It is actually the link located at the URL but will have extra strings, so you would need to remove those.
http://<mysharepoint>/<mysite>/<myformname>/Forms/AllItems.aspx
So you should only use http://<mysharepoint>/<mysite>/<myformname>/
When you publish a form, it automatically becomes the default template, whether the library already exists or not. Also, if you decide to publish the form without a pre-created library, you will be prompted for an option to update an existing library or create a new one at the Publishing Wizard.
Lastly, re-publishing a form. Go to File>Publish>SharePoint Server. When prompted for a SharePoint site, enter a new site URL ( http://<myserver>/<mysite>/ ) (see image below). This allows you to change the library location, and you can also re-use the same server. Simply select Create a new form library in order to use a new library (see image above).
Thanks for that donstephen. I am glad that I had the right thought process about this. I have uploaded the form and when I access the form library I do not see the form. This is what I see:
Is there something that I am doing wrong? Wouldn't I see the form listed in this space? When I published the form I had it create a new form library to which the form was published but it does not display it in there. Am I missing some steps?
You're welcome remigiuszmarian. Regarding the image, you would need to click on "new document" to add a form, but I am guessing that what you want on this page is the view of the form itself. For that, you would need to create or add a web part, and you would need to configure the page to the way you want it presented. Hope this helps.
donstephen,
I would like for the user to be able to click on "New Document" and have the form appear. This did not happen after I clicked the "New Document" option. How would I go about resolving this? I think that it might be something to do with the form settings but I am not entirely sure if the security and trust area is where I should look (in the form options) or should I be looking somewhere else.