Expand my Community achievements bar.

SOLVED

Add Char limit validation for custom field

Avatar

Level 2

Hi Team, 

 

My use case is to add the char limit to the single line text. I don't see any OOTB option available.

 

Any thoughts on this??

1 Accepted Solution

Avatar

Correct answer by
Employee

I can see the question has an accepted answer, but I am happy to let you know that with the release of 25.10 you can achieve this via Custom Field Validations. You can even show the number of characters that are over the limit in the error message. A good example of it can be found under this discussion. Hope this helps.
https://experienceleaguecommunities.adobe.com/t5/workfront-discussions/validation-logic-in-custom-fo...

View solution in original post

6 Replies

Avatar

Community Advisor

There is no such functionality. You have 2 options

  • Alert the user by placing a calculated field that shows an error message in case of exceeding the limit (this won't keep the user from submitting though)
  • Use Fusion to handle after submission (ie, truncate the value, send notification, or undo the change.

What's the use case that you want to constrain the char limit?

Avatar

Level 2

Thanks for the relay.

 

We are using the field to fill out some text in the form. 

Avatar

Community Advisor

Well, yes. 
Let me rephrase: Why do you want to limit the characters a user can enter?

Avatar

Correct answer by
Employee

I can see the question has an accepted answer, but I am happy to let you know that with the release of 25.10 you can achieve this via Custom Field Validations. You can even show the number of characters that are over the limit in the error message. A good example of it can be found under this discussion. Hope this helps.
https://experienceleaguecommunities.adobe.com/t5/workfront-discussions/validation-logic-in-custom-fo...

Avatar

Level 7

There are the character limits that do exist on certain things in Workfront.

If you just looking for char limit on the Report view, you can do that on column text mode on your custom field.


valueexpression=CONCAT(LEFT({DE:XYZ},100),"...")

If you find this helpful, please mark this as 'Correct Reply' to help others. Thanks!!

Avatar

Community Advisor

 

Hi @sateeshkreddy,

 

This request has been around for a long time, but your particular thread led me to a new possible solution (untested):

 

  • provided you are on the Ultimate licensing plan
  • using the (then included) Business Logic
  • having confirmed that custom parameters are supported
  • it might be possible to create a business rule that prevents saving a value beyond some maximum desired length (e.g. LEN({DE:MyText} <> LEFT({DE:MyText},100), with a warning to the user explaining that they must reduce it accordingly

 

Even if this approach is technically possible, I do also wonder if it would be acceptable to end users compared to other text count conventions they might be familiar with and prefer -- e.g. as they get close to the limit, seeing 3, 2, 1, 0, -1 (RED!), -2, etc. without having to hit Save to find out.

 

Still, if you (or anyone) decide to pursue it, I'd be interested to hear how it goes.

 

Regards,

Doug