Concat and Removing Unwanted Spaces - InfoPath Dev
in

InfoPath Dev

Concat and Removing Unwanted Spaces

Last post 02-25-2016 08:30 AM by griddle. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 02-24-2016 04:05 PM

    Concat and Removing Unwanted Spaces

    Hello, apologies if this has been answered, but I couldn't find exactly what I was looking for.

    This is for a web-based form that directly updates a SharePoint list. 

    I'm looking to concat several text boxes into one.  Not all the original text boxes will contain text. 

    Example:

     field1, field2, field3, field4, field5, and field6 need to be concatenated into field7 with a single space between the values.

    What I'm using as the formula on field7:  concat(field1, " ", field2, " ", field3, " ", field4, " ",field5, " ",field6) 

    What's happening is that if field1 and field2 and field3 contain no text, when it concatenates fields4-6 into the SharePoint list, there are leading spaces that I don't want to appear.

    When previewing the form from design mode, field7 appears to look ok, with no leading spaces if the first several fields don't contain text.  The leading spaces appear once the form is published and used in-browser, and in the SharePoint list once submitted. 

    Thanks!

     

  • 02-25-2016 07:42 AM In reply to

    Re: Concat and Removing Unwanted Spaces

    Maybe try wrapping your concat in a normalize-space function? normalize-space(concat(field1, " ", field2, " ", field3, " ", field4, " ",field5, " ",field6))
    Hilary Stoupa

  • 02-25-2016 08:30 AM In reply to

    Re: Concat and Removing Unwanted Spaces

    Hilary Stoupa:
    Maybe try wrapping your concat in a normalize-space function? normalize-space(concat(field1, " ", field2, " ", field3, " ", field4, " ",field5, " ",field6))
     

     

    Perfect, thanks! 

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