Expression Box Help - InfoPath Dev
in

InfoPath Dev

Expression Box Help

Last post 09-05-2009 08:49 AM by JRodimus. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 09-03-2009 09:55 PM

    Expression Box Help

    Hi All, 

    I was wondering if there was anyway to use an expression box to automatically combine the content of two text boxes.

    For example, I have one box for first name and another for last name.  Can I get an expression box (or something else) to automatically join this content for another section of the form? Also, can I get it to automatically insert a comma in between these?

    Sorry if this has been posted elsewhere... I have done several searches but haven't had any luck tracking this down.  Thanks for any help!

     

    Filed under:
  • 09-03-2009 10:21 PM In reply to

    Why u want to do that using expression box,when u can do that easily using Concat function in string. Is there any specific purpose for doing that using expression box..
    Vishal Srivastava
    Senior Software Engineer
    SDG Software Pvt Ltd
  • 09-03-2009 11:19 PM In reply to

    Oh wow, thanks!  I thought I needed to use the expression box... I guess that explains why I kept getting errors.

    Btw, do you know how to automatically add a comma and space in between these entries?  When I do concast(field 1, field2) it comes out as field 1field2.  

    Sorry if this is a stupid question:(

  • 09-03-2009 11:26 PM In reply to

    do this concat(field 1,",",field2)

     

    Vishal Srivastava
    Senior Software Engineer
    SDG Software Pvt Ltd
  • 09-03-2009 11:36 PM In reply to

    you can just use go to the field in which you want the value and set its value to concat(field1,",",field2), that will be easier than using expression box, you will also have to check the box that say "Update this value when the value of the formula is recalculated.

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 09-04-2009 07:43 AM In reply to

    Perfect, thanks guys!!

  • 09-04-2009 01:52 PM In reply to

    So I thought I had this all figured out, but then I notice that a comma is inserted even if nothing is listed in one of these fields.  So I get (field 1, ) or ( ,field 2).  Any idea how to make the comma dependent on having content listed?

    Also, can you use the concat function with a check box?  Meaning if I have 3 check boxes that say morning, afternoon and evening.. and 2 are checked, InfoPath automatically fills a text box that reads morning, evening

     

  • 09-04-2009 04:15 PM In reply to

     The simplest thing to do would be to use conditional formatting hide the expression box if the fields are blank, or if they're not always blank at the same time, split it into three expression boxes: [field1][, ][field2] and hide the middle one when field1 or field2 is blank.

    Similarly, the easiest thing for your second scenario would be to have five expression boxes side-by-side: [morning][, ][afternoon][, ][evening], and show or hide them appropriately based on the state of the checkboxes.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 09-05-2009 08:49 AM In reply to

     Thanks Jimmy, that worked perfectly.

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