Tuesday, 31 March 2026

Remove HTML Tags in Maximo using Automation Script

In one of our previous articles, we explored how to remove HTML tags from Long Description fields in Maximo using regular expressions.

Maximo Script to Remove HTML Tags Using Regular Expression

In this post, we’ll look at a much easier and cleaner method using Maximo’s out-of-the-box utility library.

Maximo stores rich text (HTML) in Long Description and work log fields. However, in some cases, you may need,

  • Plain text for integrations
  • Clean output for reports
  • Simplified data for processing or validation

The below python automation script removes HTML tags and converts content into clean plain text,

from psdi.util import HTML

longDesc = mbo.getString("DESCRIPTION_LONGDESCRIPTION")
print(longDesc)

longDesc = HTML.toPlainText(longDesc)
print(longDesc)

Input:

<div>Item </div><div>Long </div><div>Description <br /></div><!-- RICH TEXT -->

Output:

Item Long Description

No comments:

Post a Comment