Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
FileMaker 2026 Released

To HTML functions

Featured Replies


We have a few functions in the MBS FileMaker Plugin to convert things to HTML. That is useful to visualize HTML or JSON. You may convert text, styled text or MarkDown to HTML.

JSON

We often have to debug our code for web services and display JSON for debugging. There our JSON.ToHTML function helps a lot. We can pass the JSON and receive some HTML, which we display into a web viewer.

e.g.

MBS("JSON.ToHTML"; "{\"FirstName\": \"John\", \"id\": 123}")

Returns:

<html>
<head>
   <meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body>
<div class="JSONObject">
<table border=0 cellpadding=1>
<tr class="odd"><td>FirstName</td>
<td>John</td></tr>
<tr class="even"><td>id</td>
<td>123</td></tr>
</table></div>
</body>
</html>

Here is a little script to take some html, convert it to HTML and load it into a web viewer:

# now make html Set Variable [ $html ; Value: MBS( "JSON.ToHTML"; $json) ] # and show in web viewer Set Web Viewer [ Object Name: "web" ; URL: "data:text/html;charset=utf-8," & $html ]

Which looks like this:

FirstName

John

id

123

XML

Similar to JSON above, you may want to display XML. Our XML.ToHTML functon builds a HTML with tables to show the various layers in an XML document. All the keys and values show up with indention to show the level. You may use a CSS for odd and even rows to colorize the cell backgrounds.

e.g.

MBS("XML.ToHTML"; "1234John"; 0; "")

Returns:

<html>
<head>
   <meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body>
<h3>test</h3><div class="Elements">
<table border=0 cellpadding=1>
<tr class="odd"><td>id</td>
<td><p>1234</p></td></tr>
<tr class="even"><td>name</td>
<td><p>John</p></td></tr>
</table></div>
</body>
</html>

Which looks like this:

test

id

1234

name

John

Styled Text

You may want to have users type some styled text in a field. Later you convert the styled text to HTML with our Text.TextToHTML function or GetAsCSS(). Our function does have a few options for the HTML generation.

e.g.

MBS( "Text.TextToHTML"; "Hello World¶¶Just a test¶¶😀"; 32 + 1 )

Returns: 

<p>Hello World</p>
<p>
Just a test</p>
<p>
&#128512;</p>

Which looks like this:

Hello World

Just a test

😀

Text

When you have text and you like to include it in a HTML piece, you need to encode the various special characters. Our Text.EncodeToHTML function looks for various special characters and does proper escaping. This way you guarantee that all the accents, asian characters or even smileys survive when embedding some text in HTML, e.g. for an email.

e.g.

MBS( "Text.EncodeToHTML"; "Hast Du Äpfel? 🍎" )

Returns: 

Hast Du &Auml;pfel? &#127822;

Which looks like this:

Hast Du Äpfel? 🍎

MarkDown

For MarkDown text, you can use our Markdown functions to convert to html and show in a web viewer. For this you combine the MarkDown.Create function with either the MarkDown.HTML function for just the html snippet, or you use the MarkDown.HTMLDocument function to get a full document.

e.g.

Set Variable [ $r ; Value: MBS("MarkDown.Create"; "Text attributes *italic*, **bold**, `monospace`, ~~strikethrough~~ .") ] 
Set Variable [ $html ; Value: MBS("MarkDown.HTMLDocument"; $r) ] 
Set Variable [ $r ; Value: MBS("MarkDown.Release"; $r) ]

From HTML

Sometimes you need the other way around. Parse the HTML into something useful. Our Text.HTMLtoJSON parses the HTML using the tidy library and outputs the nodes as JSON. This way you can use JSON functions to work on the HTML and read values. Especially JSON.Query and JSON.Search may help here to find values in the parsed HTML.

When you like to convert the html to styled text, we have the Text.HTMLtoStyledText function. It parses the HTML and converts the styles FileMaker supports from HTML tags to something FileMaker can understand. Various CSS rules will not work, but in general it works often fine for HTML from emails with inline styles.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.