0

Change Rich text field to Multiline text field - so can export to excel with code

I need to change a rich text field to a multiline text field across the database, globally. I'm a newbie. The reason I'm doing this is because when I export rtf field to excel, it presents as code. Can someone help?

1 reply

null
    • Fred
    • 2 yrs ago
    • Reported - view

    Hi Joanna -

     

    Let me see if I can help.

     

    To remove the HTML code from Rich Text fields you can do create a formula field an put this in the formula section:

     

    text(richtextfieldname)

     

    Then you can export this formula field instead of the rich text field. This way you can keep using your rich text field.

     

    The one issue you will find is that it strips even the paragraph breaks, so if you have lots of those this might not be the best solution.

     

    If you want to use multiline fields, you can test out the changes by first doing a button. You can create a button and put this in the On Click:

     

    yourMultiLineField := text(yourRichTextField)

     

    Once you are OK with the changes, and are comfortable changing your entire DB, then you can run the following command at the console.

     

    1) go to the console (after you open your DB, click on the name of the DB, go to Admin mode, click on Console

    2) type this in

     

    for r in (select yourTable)

    r.yourMultiLineField := text(r.yourRichTextField)

     

    3) click Run

     

    Good luck and let us know how it goes.

Content aside

  • 2 yrs agoLast active
  • 1Replies
  • 428Views