Quantcast
Channel: SharePoint Legacy Versions - Using SharePoint Designer, InfoPath and Other Customizations Forum
Viewing all articles
Browse latest Browse all 2319

Spaces not appearing in InfoPath 2010 XPath Concat

$
0
0

I have an InfoPath form that users are submitting information to a linked SharePoint list.  Within this form, I have a number of Check boxes that the users can select from to identify specific areas that are impacted by the request.  Within a separate Text field, I have an XPath formula that concatenates the check boxes along with potential commas and spaces to help separate out the results.  The problem I have is that in the substrings of ", ", the space is disappearing from the final results displayed in the text field.  I have tried a few different options, but the below formula is the one that works best for my needs but it still doesn't include the space after a comma:

Formula:
concat(chkbx1, substring(", ", 1, string-length(chkbx1) * string-length(chkbx2) > 0), chkbx2, substring(", ", 1, string-length(concat(chkbx1, chkbx2)) * string-length(chkbx3) > 0), chkbx3)

To give a little explanation of the above formula, basically each check box returns a specific string of text if the check box is checked.  If it is not checked, then the text value returned is simply "".  Each of the substring functions check the length of the previous check boxes and multiplies that by the current check box and if it is equal to 0 (basically no previous check boxes and the current check box have been checked) then don't display anything.  If the length of the check boxes values is greater than 0, then include the ", " in the concatenation between the previous and current check boxes.  So, with this said, say that Check Boxes 1 and 3 have been checked, the text output should be:  chkbx1, chkbx3 But, it is instead returning chkbx1,chkbx3  <--- no space after the comma

Any suggestions on how to get my space to appear would be greatly appreciated.


Viewing all articles
Browse latest Browse all 2319

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>