Automation Action – Convert JSON To HTML | ThinkAutomation

Automation Action: Convert JSON To HTML

Convert Json to a readable HTML table and assign the HTML to a variable.

Converts any Json text to a HTML table.

This action is useful when you read Json data from a database, web resource or web API etc., and you need to easily convert the content to readable HTML. The HTML can then be included on outgoing emails or used as a return value for webform Message Sources.

In the Json editor, enter or paste the Json text, or use a %variable% replacement for Json created from an earlier action.

The Preview window will show a preview of the HTML created. The Json will be converted to a HTML table. Sub-objects/arrays etc will be converted into nested tables.

You can optionally add a Title which will appear above the table.

Enable the Convert Property Names option to convert camelCase property names into separate words. For example: customerName will appear as Customer Name.

If the Return Full Page option is enabled then the returned HTML will include html, body, head tags. Otherwise only the table html will be returned. This is useful if you are embedding the table into an existing HTML document.

If the Use Default Styles option is enabled then the table will have a default style sheet applied.

You can also optionally add any custom CSS (eg: body {background-color: lightblue;}).

Select the ThinkAutomation variable to receive the HTML from the Assign Html To list.

Example:

The following Json:

 { "Name": "ABC Limited", "EmailAddress": "a.dutchess@abclimited.com", "Address": { "AddressType": "POBOX", "AddressLine1": "P O Box 123", "City": "Wellington", "PostalCode": "6011", "AttentionTo": "Andrea" }, "Currency": "NZD" }

Would be converted to:

 <table> <tbody> <tr> <td><b>Name</b></td> <td> ABC Limited </td> </tr> <tr> <td><b>Email Address</b></td> <td> <a href='mailto:a.dutchess@abclimited.com' target='_blank'>a.dutchess@abclimited.com</a> </td> </tr> <tr> <td><b>Address</b></td> <td> <table> <thead> <tr> <th>Address Type</th> <th>Address Line1</th> <th>City</th> <th>Postal Code</th> <th>Attention To</th> </tr> </thead> <tbody> <tr> <td>POBOX</td> <td>P O Box 123</td> <td>Wellington</td> <td>6011</td> <td>Andrea</td> </tr> </tbody> </table> </td> </tr> <tr> <td><b>Currency</b></td> <td> NZD </td> </tr> </tbody> </table>
This is one action from over 180 actions included with ThinkAutomation. The ThinkAutomation business process automation (BPA) solution is designed to automate on-premises and cloud-based business processes that are triggered from incoming messages. Automate messages received by email, database updates, webhooks, web forms, web chat, SMS messages, Twitter, Teams messages, documents, local files and other messages sources. Create any number of workflow automations using the drag-and-drop low-code designer. Simple fixed pricing, with unlimited message processing reduces overall costs compared to hosted automation solutions.

You can also extend ThinkAutomation by creating your own custom automation actions using the built-in designer and C#/VB.net code editor.

Download Free 30 Day Trial

Back To Automation Actions List

ThinkAutomation Home