Strip html from formula text field

  • 0
  • 2
  • Question
  • Updated 10 months ago
  • In Progress
The first field on my edit form is "Organization".
This field is set as the field for the form title.
It is a rich text field.
Problem is that the form title displays the name of the organization in the title with all the html code. Yuck.
I'd like to create a formula text field that will read the contents of the Organization field but strip all the html thereby producing 'normal' text.
Photo of ed cooper

ed cooper

  • 880 Points 500 badge 2x thumb

Posted 10 months ago

  • 0
  • 2
Photo of Gaurav Sharma

Gaurav Sharma

  • 5,756 Points 5k badge 2x thumb
Can you please share a screenshot of the Organization field? So, I can see the formatting of that field or what formatting you have applied in that rich-text field?

Thanks,
Gaurav
Photo of ed cooper

ed cooper

  • 880 Points 500 badge 2x thumb
I've gone back to formatting the Organization field as a text field. Thanks anyway. Spent too much time on this already.
Photo of Matthew Neil

Matthew Neil

  • 31,438 Points 20k badge 2x thumb
(Note Tested)

Try creating a formula text field to mirror your [Organization] field.
Use the formula

ToText([Organization])

That might work, but i bet it will still get some weird stuff.
Photo of ed cooper

ed cooper

  • 880 Points 500 badge 2x thumb
Didn't produce a different result.
Thanks anyway.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,256 Points 50k badge 2x thumb
Ed, what field type was that formula field?  If it was a formula Rich text field can you try a field type of formula text and not formula rich text.

You will then see code like this.

<span style="color:#FFFF00;"><span style="font-size:11px;"><span style="font-family:tahoma,geneva,sans-serif;"><span style="background-color:#FF0000;">hello</span></span></span></span>

Now, if your users have gone crazy with formatting it will be difficult to parse out the actual words.  In my case my field said "hello", and I had lots of formatting.

But if the formatting is standard and you post the resulkant HTML code like i did, we may be able to write a formula to parse out the actual words.
Photo of ed cooper

ed cooper

  • 880 Points 500 badge 2x thumb
I've decided it's not worth the effort. Changed field type back to text. I appreciate your effort.