You should be able to accomplish this using a formula field with the LEN() action (counts the string characters) and then some IF statement logic. You’d just have to define how many characters constitute One-Liners, Paragraphs, and Essays. I don’t have time to write the formula but the logic is essentially counting the characters and if over 150 but under 500= 1 liner, if over 500 but under 1500= Paragraph, and if over 1500= Essay. You can then format the formula field to display like a single select.
Hey @ceg_,
What makes for a line on your use case? A certain amount of characters (as described by @DisraeliGears01) or a line break (enter) on your long text field? Would you mind sharing some more detail?
Mike, Consultant @ Automatic Nation
Hey @ceg_,
What makes for a line on your use case? A certain amount of characters (as described by @DisraeliGears01) or a line break (enter) on your long text field? Would you mind sharing some more detail?
Mike, Consultant @ Automatic Nation
They are all line breaks so the variation in category is the difference between:
Copy A
“Hey, how are you?”
“I’m well, you?”
Copy B
“Hey, how are you?”
“I’m well, you?”
“Hanging in there, work’s been crazy lately.”
“I feel that. I hope it slows down for you soon.”
“Thanks, I appreciate it.”
And I’m looking to classify them into:
One-Liners: 1-4 Lines
Paragraphs: 5-14 Lines
Essays: 14+ Lines
I have those three categories currently written as in my single-select ‘Length’ field but have had to look through each record and manually select the category.
Hi @ceg_,
You should be able to accomplish this with a formula. Since you are dealing with line breaks, you need to find a way to count the line breaks in your text field. Essentially number of line breaks plus 1 should equal the total number of lines.
You can try something like this:
LEN({Your text field}) - LEN( SUBSTITUTE({Your text field}, "\n", "") ) + 1
This formula uses the length of the text minus the length of the same text field without the line breaks. This difference should give you the number of line breaks in the text field.
You could take this formula a step further and use nested if statements to assign the category based on number of lines:
IF(
( LEN({Your text field}) - LEN( SUBSTITUTE({Your text field}, "\n", "") ) + 1 ) <= 4,
"One-Liners",
IF(
( LEN({Your text field}) - LEN( SUBSTITUTE({Your text field}, "\n", "") ) + 1 ) <= 14,
"Paragraphs",
"Essays"
)
)
Hope this helps!