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

Question

Question

Field functions - how to remove CRLF from a string , replace with space, and place into field

asked on April 12, 2018 Show version history

Team LF,

I have an address field that is free form, multiline - client types in free form text, as this can take many formats.

Business rules say that the contents of this field should then be collected as a subject line in another SINGLE-LINE field

I have written a function on the single line field to grab the contents of the multi-line field - but the CRLF is ignored, and there is no whitespace and things look sloppy.

I tried to code the function as such:

=SUBSTITUTE(Location_Address, "\r" ,"  ")

which resolves to

LF.f.SUBSTITUTE(LF.f._TFIELD(36),\"\\r\",\"  \") in the deployed script, which because my original is now double-escaped , isn't going to work, as it will be searching for the actual string value, not the escaped value.

How to hack this without too much hack-i-ness?

 

 

 

0 0

Replies

replied on April 16, 2018

Hi Mark,

Rather than using the formula to replace the carriage return character (\r), you may want to try replacing the newline character instead (\n). The formula below takes the text in the multi line field and replaces line breaks with spaces:

=SUBSTITUTE(Location_Address, "\n" ," ")

Hope this helps, and let me know if you have any further questions!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.