I have a 'Body' (rich text field) that captures the body of an email from Outlook through a Quick Base Pipeline. The rich text from 'Body' is then passed to another field, 'Body Field' (rich text ...
It's not the cleanest... but since your Body Field is already a QB Formula field, you might be able to get away with doing some SearchAndReplace() functions to change the <body> and </body> to say <div> </div>... and then remove the html tags all together.
Or, a more non native would be too see how to just get the body.innerHTML of the original html information... but that's a JavaScript notation, not QB Formula notation.
Or also instead of mid, try part instead, using <body as the delimiter.
Part([Body],2,"<body")
You'll still need to purge out the other information of the rest of the opening body tag... but this could get you in the right direction.
------------------------------ Ryan Stanford ------------------------------
I was finally able to come back to this and get it to work. I do know how to do this in JavaScript, but I'm not sure how to implement it in JavaScript inside of a Formula Rich Text Field. Because of how QB names elements, it would be difficult to grab the specific field without class names or ids. I tried this with JS, but, again, not sure how to implement this in QB.
Here's the formula I used to do this: var text htmlField = [Body]; var text htmlStart = SearchAndReplace($htmlField, "<html", "<div"); var text headStart = SearchAndReplace($htmlStart, "<head", "<div"); var text metaStart = SearchAndReplace($headStart, "<meta", "<div"); var text startStyle = SearchAndReplace($metaStart, "<style", "<div"); var text endStyle = SearchAndReplace($startStyle, "</style", "</div"); var text endHead = SearchAndReplace($endStyle, "</head", "</div"); var text startBody = SearchAndReplace($endHead, "<body", "<div"); var text endBody = SearchAndReplace($startBody, "</body", "</div"); var text endHtml = SearchAndReplace($endBody, "</html", "</div"); $endHtml
Here's the result:
------------------------------ AR ------------------------------