Apend values from multiple checkboxes to email subject line? - InfoPath Dev
in

InfoPath Dev

Apend values from multiple checkboxes to email subject line?

Last post 07-14-2011 04:22 PM by ynygma. 19 replies.
Page 1 of 2 (20 items) 1 2 Next >
Sort Posts: Previous Next
  • 06-29-2011 09:38 AM

    Apend values from multiple checkboxes to email subject line?

    Hello all,

    I am a novice to both InfoPath and VBA but I am learning:)

    I have an InfoPath form with multiple checkboxes.  The user can check multiple checkboxes in the form and I want the Display names of the checkboxes to be concatinated to the email subject line in my data connection.

    This is beyond my knowledge of InfoPath at this point and would please like some help so I can figure this out.

    Thank you,
    Ynygma

  • 06-29-2011 02:38 PM In reply to

    Re: Apend values from multiple checkboxes to email subject line?

    Hello Ynygma,

    I would make the check boxes Data Type= Text (value when clear blank and value when checked custom value)

    Now add a new data connection.. Send (as an email message) Use the concat fucntion on the subject line to include the checkbox values. The subject line will now contain these values when selected.
    ( i.e. subject line fx=concat("Thank you", Checkbox1, Checkbox2) )

    Should work..

  • 07-04-2011 11:09 AM In reply to

    Re: Apend values from multiple checkboxes to email subject line?

    Thank you for your assistance:)

    I am having some trouble with teh concat formula though.

    So, I got it to work as you suggested but there is a spacing issue.

     

    So lets say I have a long concat formula with a dozen checkbox values but the user only checks 2 of them.

     The subject comes out someting similar to this "Notification - Lastname VALUE1                                                      VALUE8"

     Is there anyway to keep the values seperated by only 1 space if only 2-3 boxes are checked?

     Again, thanks for all the help; I am learning a lot!

     Ynygma

  • 07-05-2011 10:36 AM In reply to

    Re: Apend values from multiple checkboxes to email subject line?

    I'm glad you were able to get the concat working.. If you need to have a comma you could add the comma to each value when the box is checked. Normally if I do something like this I just make the check-box value like this ( value ). Now the values look better and are easier to read when they are published to SharePoint. Either way should fix the issue.
  • 07-05-2011 10:52 AM In reply to

    Re: Apend values from multiple checkboxes to email subject line?

    Sorry I did not reply.

     I was able to figure this out a different way:)

     What I did, was create 2 hidden fields: hidden1 and hidden2

    I then assigned a rule to each checkbox that states "if not blank then assign hidden1(or 2 if appropriate) the value of "value"
    In turn, I created an additional rule that states "if it is not blank then assign hidden1 the value of ""

    This way if the box is unchecked or checked it adds teh value to the subject line as needed.  So my concat formula just referrences these 2 hidden fields.

     What I am trying to tackle now is data validation.  I want to have it where if one checkbox is already checked then you get a warning that says only one checkbox can be checked.  Having difficulty with this one...

     Thank you,

    Ynygma

  • 07-05-2011 12:38 PM In reply to

    Re: Apend values from multiple checkboxes to email subject line?

    You can make one datasource and tie each checkbox back to that datasource (but keep the value of each checkbox different). Now you should be able to force them to check one box and when it is checked disable the rest?
  • 07-05-2011 09:17 PM In reply to

    Re: Apend values from multiple checkboxes to email subject line?

    I am not following. I have an email submit datasource already for rhe form. Can you please elaborate?:) Thank you, Ynygma
  • 07-06-2011 05:34 AM In reply to

    Re: Apend values from multiple checkboxes to email subject line?

    I am a little confused on how you want the validation.

    Are you trying to to make sure both check boxes are checked before sending the email?

    Or, just want to notify the user that one of the boxes has not been checked and it can be emailed as is?

  • 07-06-2011 05:43 AM In reply to

    Re: Apend values from multiple checkboxes to email subject line?

    Not exactly. There are 2 columns of checkboxes. Only 1 checkbox per column should be checked. So what I would like is when you hit the submit button, if more that 1 box per column is checked, you get a validation error that won't let you send the email until you only have 1 check per column.
  • 07-06-2011 05:56 AM In reply to

    Re: Apend values from multiple checkboxes to email subject line?

    Thats not hard then.

    Add a new field called Submittable (Name as you like) should be a boolean, set to false.

    In the Submit button, setup a new rule that checks to see if either box1 OR box2 is checked, Add Action set Submittable to true. 

    In the Submit button, setup a new rule that checks to see if each box1 AND box2 are checked, Add Action popup message. and set Submittable to false.

    Make sure these are in order, this checks to see that one of the boxes is checked and won't let you email if they both are checked.

    In the Submit button, setup new rule to check if Submittable is true, Add Action to email to that datasource.

     

    Test to make sure it works as planned and you should be good.

    Hope this helps.

  • 07-06-2011 06:19 AM In reply to

    Re: Apend values from multiple checkboxes to email subject line?

    I think I am getting it... So this applies if I have 7 boxes on the first column and lets say 9 on the second. So with multiple boxes in each column, would it be like box1a OR box2a, box1b OR box2b? When you said make sure they are in order that is what throws me. So it looks like this Column 1: Column 2: x checked x x x x x x x x x checked x Any 2 of those boxes 1 in each column can be checked, and they do not have to be on the same row. But what I don't want is for the user to check 2 in the same column. I would send you an example if I could..but I am unable to upload from here.
  • 07-06-2011 06:33 AM In reply to

    Re: Apend values from multiple checkboxes to email subject line?

    Its ok if you can't upload, I am starting to get what you are looking for.

     

    For that, you will have to do a little more work.   This is what I would do for this.

    Add 2 new Fields, named Column1Selected and Column2Selected (Name as you wish), set as boolean, set to false.

    Now for every Checkbox in Column1, add a rule to check if Column1Selected is set to false and if this Checkbox is checked, Add Action to set Column1Selected to true.

    Also add a rule to check if Column1Selected is set to true and if this Checkbox is checked, Add action to popup message.

    Do the same for Column2Selected.  It is more work.

    When I said to make sure they are in order, if the are put in, in the wrong order, the rules won't work correctly. (A comes before B kind of thing) 

     

    You can probably ignore the previous post since I was still confused on what you needed.

  • 07-06-2011 12:40 PM In reply to

    Re: Apend values from multiple checkboxes to email subject line?

    Hmm,

     

    OK, I got everything setup like you instructed, but I am getting validation errors when trying to submit:

     InfoPath cannot submit the form.
    The form cannot be submitted because it contains validation errors. Errors are marked with either a red asterisk (required fields) or a red, dashed border (invalid values).

    If I go into those boxes and turn of those 2 rules then it works fine.

     The other question I have is, should I not have gotten a Prompt as soon as I checked the second box or does this only happen on submit?

     Thank you again for all the assistance:)

     Ynygma

  • 07-06-2011 12:54 PM In reply to

    Re: Apend values from multiple checkboxes to email subject line?

    I think we may have disconnect here.

    The rules being setup won't go into the data validation part of the properties of the field, it will be a regular rule.  The reason being is that using regular rules give you more control over certain aspects that data validation cannot.

    Data validation works great to make sure a field is not blank, or is a number, etc., but in this case, you are trying to make sure that only 1 out of the 7 or 9 fields in checked. Data validation would be harder.

    Using the rules to do it, is doing a "fake" (not really fake, but we not using the data validation button) kind of data validation while also making sure only one is checked.

     

    You should get some kind of prompt when more than one box is checked from the same column.  You can add more rules to check to make sure that only one box is selected from both columns before you push the submit button.

     

    Im curious as to why you didn't use a button group for your columns.  A button group would solve the more than one selected in a column problem instantly with no rules. (I should have thought of it earlier)

  • 07-06-2011 01:07 PM In reply to

    Re: Apend values from multiple checkboxes to email subject line?

    The rules being setup won't go into the data validation part of the properties of the field, it will be a regular rule.  The reason being is that using regular rules give you more control over certain aspects that data validation cannot.

     No, the rules I have set up are in the "Rules" not the Data Validation.

    But, no, I am not getting any prompt when I select more than 1 box:(

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