Software Venture Consulting

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages

Shopping Cart
Shopping Cart


Free Newsletter


Privacy Policy

FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.


 FileMaker Pro Custom Functions

List  |  Show Random  |  Upload  |  Add This to Your Site

HTMLtoText ( text ; returns )

Rate this function:  

  Average rating: 3.8  (60 votes)
  Discuss this Custom Function

Mogens Brun, FM Integrator

Convert HTML text to text preserving bold and italic styles (v. 1.04).

Sample Input:
HTMLtoText ( "</h2>
<h2>Product Description:</h2>
Over 50 Conversions Very Quick<br /> Copy With click of 1 button<h2>What's new in this version:</h2>" ; "single" )
Sample Output:
<h2>Product Description:</h2>Over 50 Conversions Very Quick
Copy With click of 1 button<h2>What's new in this version:</h2>

 Then copy & paste into FileMaker Advanced's Edit Custom Function window.


Together with two subordinate custom functions "HTMLtoText_deleteTags" and "HTMLtoText_convertStyle" (also found on this site) this function will parseHTML text to plain text with preservation of any italic or bold markup in the HTML text. Several pages of text may be converted with reasonable text formating. The HTML text could be imported in a field by Troi URL plug-in, Fusion TCPdirect plug-in or by FileMaker GetLayoutObjectAttribute ( "WebViewerName" ; "content" ).

The second parameter (returns) controls if no empty lines should be allowed ( returns = "single") or one empty line may be allowed between paragraphs (returns = "double") with "double" as default.

Note: Requires FileMaker 10 or higher - unless 3 special char-values are stored in global fields.

Note: these functions are not guaranteed or supported by Please contact the individual developer with any questions or problems.

This is my Custom Function and I want to edit it


5 most recent comments | Show all 10 comments


i would like to have to output of the field into DB readable format like

"field1-1.row", "field2-1.row", "field3-1.row"
"field1-2.row", "field2-2.row", "field3-2.row"

any ideas?

Peter, Internet
June 10, 2014 5:00am

I've copied and pasted all three functions so I think they're accurate but the function is converting both <i> and <b> tags to bold.

I'm seriously impressed with the rest, though!

Any ideas what I might have done wrong?


Alastair, Edinburgh
February 10, 2015 7:44am

I answered my own question by adding a parameter, StyleToAdd to the HTMLtoText_convertStyle function and then using the parameter instead of 'Bold' in the second bottom line.

Then I added either 'Bold' or 'Italic' (without apostrophes) to the relevant lines of this function.

Thanks again.

Alastair, Edinburgh
February 10, 2015 7:54am

Very helpful custom function - have been using it for a few years. Getting one unexpected result; any ideas?

This HTML:

From: <b class="gmail_sendername">John Doe</b> <span dir="ltr">&lt;<a href=""></a>&gt;

Displays in a browser as:
From: John Doe <>

But the custom function seems to delete the space and the less than symbol that proceeds the email address giving this result:

From: John>

Holly Headhunter, Nashville TN
September 23, 2016 7:35am

Really really marvelous. Thanks a lot !!! I added some special characters like "&mdash" or &rsquo; for example, that are not converted. Very nice result.

Tigrou83, France
August 27, 2017 6:24am

Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:

Your Name:
characters left. If you paste in more than 1500 characters, it will be truncated. Discuss the function - advertisements and other useless posts will be deleted.
Answer 9 + 8 =
Search for Custom Functions:

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. SortList ( theList )
  (Sat, Jun 23, 8:45am)
2. HexUUIDToNum_cf (_uuid)
  (Sat, Jun 16, 1:55pm)
3. httpResponseCode ( responseHeaders )
  (Tue, Jun 12, 10:40pm)
4. FindDuplicateCharacters ( string )
  (Fri, Jun 08, 5:01pm)
5. FieldRepetitionLast ( field ; maxRepetition )
  (Wed, Jun 06, 6:05pm)
6. CountModifiedRecords ( NameTimestampField ; StartTimestamp ; EndTimestamp )
  (Mon, May 28, 8:23am)
7. JSONArrayLength ( JSONArrayStr )
  (Fri, May 25, 7:46am)
8. interpolation (y1; y2; y3; x1; x2; x3; x1y1; x2y1; x1y2; x2y2; rnd)
  (Sat, May 19, 3:55am)

RSS Feed of Custom Functions