Skip to main content
battulad808576
New Participant
August 17, 2026
Question

Facing issue with Style Text Editor Field when setting the character limit to 4000

  • August 17, 2026
  • 3 replies
  • 29 views

I am using “Style Text Editor “ Field for one of the input field and set the character limit to 4000 .It is showing validation for 99 percent itself that It has reached the maximum limit.

May I know Why it is happening like this and how the bolded/Italic values consumes the field characters and showing the warning without reaching 100 percent.

How this issue can be resolved?

3 replies

shubhama926776
Brainy
August 17, 2026

The Styled Text Editor’s sizeLimit counts bytes of stored HTML (including <b>, <i>, <p>, etc.), so formatting and multi‑byte characters consume part of the 4000‑byte limit and trigger the max limit warning before you reach 4000 visible characters.

शुभम्
shubhama926776
Brainy
August 17, 2026
a!localVariables(
local!filler: joinarray(repeat(400, "0123456789"), ""),
local!html: "<p>" & local!filler & "</p>",
local!rawSize: if(isnull(local!html), 0, len(local!html)),
local!textSize: if(
isnull(local!html),
0,
len(
substitute(
substitute(stripHtml(local!html), char(10), ""),
char(13),
""
)
)
),
{
a!buttonArrayLayout(
buttons: {
a!buttonWidget(
label: "Load 4000 chars",
saveInto: a!save(local!html, "<p>" & local!filler & "</p>"),
style: "OUTLINE"
),
a!buttonWidget(
label: "Load 3990 chars",
saveInto: a!save(local!html, "<p>" & left(local!filler, 3990) & "</p>"),
style: "OUTLINE"
),
a!buttonWidget(
label: "Clear",
saveInto: a!save(local!html, null),
style: "LINK"
)
},
align: "START",
marginBelow: "STANDARD"
),
a!styledTextEditorField(
label: "Size limit test",
instructions: "Load the filler, then bold any word. Each <strong> pair adds 17 bytes and pushes you over.",
value: local!html,
saveInto: local!html,
sizeLimit: 4000,
height: "MEDIUM"
),
a!richTextDisplayField(
labelPosition: "COLLAPSED",
value: {
a!richTextItem(text: "Stored bytes: ", style: "STRONG"),
a!richTextItem(
text: local!rawSize & " / 4000",
style: "STRONG",
color: if(local!rawSize > 4000, "NEGATIVE", "POSITIVE")
),
char(10),
a!richTextItem(text: "Visible text: " & local!textSize & " | Markup: " & (local!rawSize - local!textSize) & " bytes", color: "SECONDARY")
}
)
}
)



Learn from this example

शुभम्
mikes0011
Brainy
August 17, 2026

As Shubham already mentioned - all styled text carries unseen HTML formatting (and that includes even when you don’t add styling but put in paragraphs).  For increased visibility into how it roughly calculates this, show the saved raw text in something like a paragraph field component (or view it in the variable’s held value in the interface designer), where you can see the plain HTML characters it inserts as the user adds text to the field.

The Expression Guru