You are viewing limited content. For full access, please sign in.

Question

Question

concatenate not returning spaces

asked on March 30, 2017 Show version history

Sorry If this has been asked but I cannot find a solution after searching. How do you get the concatenate function to return spaces? I have entered this:

=CONCATENATE(Name_Last,", ",Name_First," ",Name_Middle)

I get the variables and the comma but no spaces. I have also tried entering:

=Name_Last&", "&Name_First&" "&Name_Middle

I get the same results.

Anyone have a fix?

0 0

Answer

SELECTED ANSWER
replied on March 30, 2017

Hi Anthony, this is a bug where any initial or final whitespace in a string constant or variable value are ignored by the CONCATENATE function; SCR 156104 has been filed. You are correct that the whitespace should be preserved per the OpenFormula specifications for whitespace.

As a workaround, you could look into using custom JavaScript; for strings, the + operator performs concatenation so e.g. "a" + " " + "B" = "a B".

0 0
replied on July 28, 2017

Hi James-

Any word on this? I don't think the 10.2.1 Update 1 fixed it.

0 0
replied on July 28, 2017

Unfortunately that is correct; it did not make it into 10.2.1 Update 1 but the priority has been increased since the original filing in our internal tracking.

1 0
replied on February 13, 2018

Hi James,

Would you be able to provide status on this SCR?  Thank you!

0 0
replied on February 15, 2018

I too am running into this issue. Please prioritize and fix.

0 0
replied on March 2, 2018 Show version history

I would like to jump on this bandwagon. I need some space! In the formulas, that is. 

I can't use javaScript because I need the data to appear on a different form that is being saved to the repository. So far, I have not been able to do much data manipulation on a form that never opens in a browser. 

0 0
replied on May 31, 2019

I have a workaround for the issue in Chrome, but the fix doesn't work for IE or Edge browsers.

I inserted an ASCII character between two tokens:

=PROPER(CONCATENATE(FirstName, CHAR(127), LastName))

 

1 0
replied on May 31, 2019

To concatenate my lookup fields in IE and Edge, including a whitespace, I used the following JS:

$(document).ready(function () {

$('.last input').on('change', name);
  
  function name() {
      
  var str1 = $('.first input').val();
  var str2 = " ";
  var str3 = $('.last input').val();
    
  var fullname = str1 + str2 + str3;
    
  $('.name input').val(fullname);
    
}

});

And I added "first", "last", and "name" CSS classes to their respective fields (in this case, a single line text box)

The function executes after the last lookup field has populated: for instance, the last name.

1 0

Replies

replied on April 12, 2017 Show version history

I don't know if this helps but I have worked around this problem by using underscores instead of spaces in the formulae and then picking up a change event and replacing the underscores with spaces via jquery as follows:

 

function ReplaceUnderscoresWithSpaces()
{ 

$(event.target).closest('ul').find('.concatenatedString     textarea').each(function() {
   	 	
      	var originalstring = $(this).val();
    	var modifiedstring = originalstring.replace(/_/g, ' ');
    
     	$(this).val(modifiedstring);
      
    });
}

$('.concatenatedString').on('change', ReplaceUnderscoresWithSpaces);

You need to add the concatenatedString class to the field with the formula. In this case it is a multiline field.

2 0
replied on October 5, 2017

Hello Ian,

 

I tried adding the jquery you posted and the css class concatenatedString to the field the two values are being brought into, but the underscore is not being replaced with a space. Any thoughts?

 

Thanks,

0 0
replied on October 5, 2017 Show version history

Hi Drew,

What type of field are you populating ? You may need to change textarea to input if it is a single line field.  Or you could use :input to cover all types of field.

thanks,

0 0
replied on August 15, 2018

Add me to the list of "Wishing-This-Wasn't-A-Feature".  

2 0
replied on October 7, 2019

Is it just me, or is this still an issue in Laserfiche Forms Professional Version 10.4.0.1256?

Concatenate is dropping spaces - not visibly on the form in the front end - but rather, once the submission is made. 

Example:

Calculating a candidate's full legal name..

V_FirstName*, V_MiddleName, V_LastName* (variables for single line inputs, * = required inputs)

+
V_FullLegalName (calculated read-only single line field)

Formula for the full legal name field calculation:

=CONCATENATE(V_FirstName, " ", IF(LEN(V_MiddleName) = 0, "", CONCATENATE(V_MiddleName, " ")), V_LastName)

Result when viewing form (before submission):

Full Legal Name:
"First Middle Last" (correct spacing) OR
"First Last" (correct spacing if middle name is left blank)

Result AFTER form submission:

Full Legal Name: 
"FirstMiddle Last"

 

Can anyone confirm if this is fixed in 10.4.1? As this issue happens after submission I don't associate the incorrect behaviour with my browser - but if it helps I'm using the latest Chrome (Windows 10 build).

If this hasn't been fixed in 10.4.1, can we please open a bug report for this formula issue (again) please?

Paging: @████████ @████████ @████████ @████████

 

Thank you!

1 0
replied on October 8, 2019

All of the known bugs associated with this post were fixed in Forms 10.3. We'll investigate the issue on 10.4.0 and 10.4.1 to see if we can reproduce what you are seeing. 

1 0
replied on October 8, 2019

Thanks @████████


I've updated my post below with some images to help show what I mean (if it helps):

 

0 0
replied on October 10, 2019

Hi Kris,

Can you provide a video to reproduce your issue? I did some tests on Forms 10.4.0 and 10.4.1 with your Formula, if I input "a b c" one by one, it won't turn out to be ab c in Variables page, so I need to know if there is some point missed, a video is much clearer.

And I can confirm if the calculated field is not read-only, there will be no such issue, you can give it a try. Workaround for now is to uncheck Read-only for this field, then use Javascript to set it as read-only like this:

$( document ).ready(function() {

$('#q29 input').attr('readonly', true);

});

 

Please let me know.

0 0
replied on October 10, 2019

Hi @████████

Rather than a video I've created a process that demonstrates the issue repeatedly (on our instance of Laserfiche Forms 10.4.0.1256.

Please rename the file to XML and upload to your test environment.

I'd be curious to know if you get a different outcome from the same process.

 

0 0
replied on October 10, 2019

Hi Kris,

With your process, I input Mike Jim and Richard one by one, and it should be "Mike Jim Richard", then in Variables page I get "Mike JimRichard", you can see the format is like "First MiddleLast". In your previous description and screenshot, it's "FirstMiddle Last", they are different issues. I can reproduce "First MiddleLast" and already filed bug 199937 for it, but cannot reproduce "FirstMiddle Last", please let know how you get that result and can you reproduce again for me?

 

2 0
replied on October 13, 2019

Good morning Zhiyong,

Thanks again for looking into this. For the test process I created, you are correct that the output on the variables page is "First MiddleLast" using Chrome, Internet Explorer, Edge and Safari.

I believe I made an error in my original post where I quoted the variable output as "FirstMiddle Last". Apologies for the inconvenience.

 

 

0 0
replied on October 14, 2019 Show version history

Hi Kris,

 

Thanks for this confirmation, so we're facing same issue, not different ones. This bug is estimated to be fixed in next Forms major release, please keep eyes on our future release notes, workaround now is as I post above.

1 0
replied on October 14, 2019

No worries. Thanks for looking into this issue and providing a decent workaround (which I've confirmed works!) in the meantime!

0 0
replied on January 22, 2021

This appears to have been fixed in 10.4.5.282

But for those with older systems, the easiest way to address this is to add a Substitute to your string to change the "," to a ", " after the CONCATENATION is completed

=SUBSTITUTE(CONCATENATE(Var1,",",Var2),",",", ")

Also, if you do it this way with no space in the original Concatenate, it won't break when you finally upgrade and the space is supported (Where you would get 2 spaces)

1 0
replied on October 21, 2021

Hi Connie, I did this test in Forms 11.0.0.537 and It appears to be as expected

=CONCATENATE("2021 Incident Report - ",IncidentType," - ",Name)

1 0
replied on October 21, 2021

Thanks, Steve.  I noticed that your formula didn't have brackets around the " - " and so I copied my form and tested after removing the brackets. It does seem to have resulted in the correct spacing.  I have adjusted the live form now and will be keeping an eye on it but that might have been it.  Thanks again!

0 0
replied on October 20, 2021

I recently upgraded to Forms 11 and now I am seeing this same issue.  So, the issue (topic of this post) seems to have stayed even on the Forms 11 upgrade.  Here is what I have seen today:

  • My formula in a hidden field in the form:  =CONCATENATE((Type_of_Incident), (" - "),(Person_s__involved.Full_Name_Person_Involved))
  • The hidden field is only there so I can get the form to Save to Repository with a better match to our Naming Convention (which is only a problem because of the way the user created his form).
  • At the end of the process, the form saves to LF and a Workflow sees it, combines all attachments into the main form entry, routes the entry to the right topic folder depending on key words in the entry name, and renames the entry to remove the Instance ID number.
  • The resulting entry name:  2021 Incident Report - Near Miss-Bert Hagel (no spaces before and after the target dash).
  • The workflow shows the Starting Entry Name as:  2021 Incident Report - Near Miss-Bert Hagel, ID # 21205 (again, no spaces before and after the target dash).

 

As you can see, the spaces placed around the targeted dash in the formula go missing somewhere between the form process and when it saves into Laserfiche.

0 0
replied on October 21, 2021 Show version history

Possible to add in a separate concatenate item for each space? I am wondering if you can use the ASCII code for space instead. Also wondering if the the existing dash in the value is effecting the outcome.

You are not allowed to follow up in this post.

Sign in to reply to this post.