Need Clean HTML-Free Comment Display in Activity History from Scoped App Without Using journal_field

anand-bhosle
Tera Guru

Hi all,

I'm working within the Third-Party Risk Management (sn_vdr_risk_asmt) application and trying to solve a common issue related to how HTML fields behave in the activity formatter.

Goal:

When users update any of our 11 custom fields (all of type HTML), we want to:

  • Log a clean version (stripped of all HTML tags)

  • Clearly label which field the comment came from (e.g., [ABC Comments])

  • Show this cleaned text in the activity history, so it's easily readable

  • Do this entirely within scope (no global writes or elevated access)

    What I've Tried:

    1. Created a Journal Input field (u_comment_log)

    2. Used a Before and After Business Rule to call setJournalEntry('u_comment_log', cleanText)

    3. Also tried populating a String field (u_clean_comment_logInstead and added it to the activity formatter

    4. Implemented logic to strip HTML using: 
      "var clean = htmlString.replace(/<\/?[^>]+(>|$)/g, ""); and also
      "GlideStringUtil.stripHTML();

    5. Enabled audit tracking, made sure no_audit = false, set field as multi-line

       

    6. Tried all combinations of:

      • Journal Input vs String

      • setJournalEntry() vs current.field = value

      • Before and After Business Rules

 

Current Roadblock:

Everything works technically — the field is populated correctly — but the cleaned comment does NOT appear in the activity stream unless the user manually toggles the funnel icon (activity filter) to uncheck/recheck the field.

I’m trying to avoid:

  • Writing directly to sys_journal_field (due to cross-scope restrictions and potential platform impact)

  • Changing global properties

  • Asking users to manually click funnel checkboxes to “wake up” the activity formatter

  • Manual cross-scope access to sys_journal_field (denied due to platform restrictions)

Has anyone achieved this before?

Specifically:

  • Has anyone successfully forced a Journal Input or String field — populated in a scoped BR — to display in the activity stream without using sys_journal_field?

  • Is there a supported or best practice workaround for logging clean comment activity from HTML fields, within scope, that shows in the activity formatted?

  • Are there any platform-level limitations in scoped apps around this behavior?

 

Any guidance, tricks, or recommended alternatives would be deeply appreciated!

Thanks in advance 🙏

 



8 REPLIES 8

Setting current.comments = 'value' will update the field’s value on the form,
but it will NOT create a journal entry in the activity history, right?

Yes, it will create  a journal entry in the activity history and it is same as your manually input the comments field in form.

That didnt work. If you see below pictures which shows activity history. One with clean text and another with HTML tags. We want this tags to be removed when displaying under Activity history. I tried custom string field, journal input and OOB comments field. None of them working. Only if you uncheck & check back the field from activity formatted using the funnel, then it is displaying.

Suvitha Murugan
Tera Contributor

Hi @anand-bhosle ,
I have a similar use case where I need to store changes to an HTML-type field in audit history, but the output appears cluttered and unreadable. I'd appreciate your thoughts on how to handle this more effectively.

SuvithaMurugan_0-1756146789478.png