client-side-text-utils-o11
Reactive icon

Client Side Text Utils O11

Stable version 1.0.0 (Compatible with OutSystems 11)
Uploaded
 on 25 Mar (4 weeks ago)
 by 
3.0
 (2 ratings)
client-side-text-utils-o11

Client Side Text Utils O11

Details
Client Side Text Utils is a lightweight, zero‑dependency JavaScript library for OutSystems ODC, delivering fast, reusable client‑side helpers for common text operations, closing gaps in native logic and keeping UI code clean, consistent, and maintainable.
Read more

Ensure to add the Text Utilities web block to the layout or the screen of the app where you intend to use the functions, else the supporting scripts will not load.


All actions are exposed as functions. Below are the list of all Text functions available:

  • Split: Splits a string into an array based on a separator with an optional limit.
  • Join: Combines an array of items into a single string using a specified separator.
  • TitleCase: Converts input text to Title Case (e.g., "hello world" becomes "Hello World").
  • SentenceCase: Converts input text to Sentence Case (e.g., "hello world" becomes "Hello world").
  • ReplaceText: Replace the first occurance of target text in a string with replacement text.
  • ReplaceAll: Replace all occurance of target text in a string with replacement text with optional match case and whole word match.
  • RepeatText: Repeats a text to a given num of times,
  • UrlSlug: Creates a URL-friendly string by removing accents and replacing special characters with hyphens.
  • TruncateEnd: Shortens text to a maximum length and appends an ellipsis if truncated.
  • FormatName: Format a person's name.

    Rules:

      - If abbreviate=false: returns "First Middle Last" (omitting missing parts)

     - If abbreviate=true: returns "F. M. Last" (first + middle abbreviated)

     - If lastNameFirst=true: returns "Last, First Middle" or "Last, F. M."

Release notes (1.0.0)
License (1.0.0)
Reviews (2)
by 
12 Apr (12 days ago)
in version 1.0.0
There is a bug in the ReplaceAll that could have been found by testing

Not sure the simplicity of the code requires the whole construct with a webblock and a script.  That means for example that any client action deep down in your logic, would force all the screens where that call possibly originates from, to have the webblock.  In turn meaning that the only easy and hassle free way to do this is to include the block in a layout, meaning loading that script all the time, even if not needed.
Answer from the owner
13 Apr (11 days ago)
in version 1.0.0
Hi Dorine,
Thank you for taking the time to review and validate the component. I truly appreciate your effort in identifying the issue. I will address and fix this in the next release.
Regarding the inclusion of the web block for loading the script, the intent was to ensure that the JavaScript remains cached in memory. Once loaded, the script benefits from OutSystems’ default long‑term caching behaviour, meaning it does not need to be reloaded on every call.
Additionally, the JavaScript contains internal logic for text sanitization that I wanted to centralize and reuse within the script itself, so that consumers of the component are not required to manage or maintain the JavaScript separately.
Kind regards,
Saugat
by 
1 Apr (3 weeks ago)
in version 1.0.0
Nice client side utility. Would love to have for numeric data as well.
Team
Other assets in this category