How to remove the New line / Line break Character

Looking for a solution to remove the line break or new line character from the text formatted line item editable by end users.

reading the text from the user editable line item to another line item, in the process want to replace new line character if any from the text. Because of New Line character the data while being exported and loaded into the target system resulting into loss of data.

Answers

  • @AtifIqbal 

    Hmmm. I've seen this before. Did you try using the TRIM function?

    https://help.anaplan.com/en/068058a3-7495-427b-bfb1-d8b9f8d0e62d-TRIM

    You can't prevent users from entering the Line Feed but you can create another line item that will remove it.

  • Thanks! We had the same problem and TRIM worked!

  • True, TRIM function has removed the above challenge and eliminated data loss problem

  • hello,

    I would like to create a conditional formating on a cell text with a break line. How can I do It?

  • Hi @mcoudeyras ,

    Could you clarify your requirement? If you're trying to differentiate between entries with a line break/new line character and the original user-entered text, you can do so by comparing their lengths. Trimming the entries with line breaks will reduce their length, which you can use to assign some value. This value can then be utilized in the conditional formatting from the UX side.

  • Hi,

    I would like to prohibit the use of break line in "free to fill" text cells. And in case of break line, create a conditional formatting via an alert

  • Hi @mcoudeyras ,

    For that you may create different Line items for your different "Free to fill" text which will be used in conditional formatting or even you can make just one combining all those. The example is shown below,
    In first Line item there's free to fill text,

    After then in Second line item there's formula as: TRIM(Text) which is for demonstration purpose you may skip this.
    And then in the Final Line Item "Line Break CF" there formula checking the length of both as

    Or it can be simply made as,

    I hope this helps.

  • AjayM
    edited October 16

    Hi @mcoudeyras ,
    We can't restrict user from using a line break within a text cell. However, there is a workaround to identify if a line break is used.
    1. Create a lineitem of text format within your input module, without any dimensions, and enter text as shown below, just "A", then linebreak, and then "B"

    2. Add two calculation lineitems as shown below to identify linebreak and its numeric position

    3. Apply conditional formatting on the original 'text input' lineitem using 'find new line pos'

    It highlighted for APAC item, because I used linebreak in the text input cell:


    You may have to verify the "sample input" cell and fill it manually in the deployed model, once you publish this change.
    Hope this helps.

    Cheers!

  • 👍️

    Perfect, it works

    Thanks a lot.