Validation for single line in String field

Hi,
I have a string field, and in this field, I want to allow the user to enter a maximum of 6 lines, with a maximum length of 26 uppercase characters or 36 lowercase characters per line. Is it possible to perform a validation on it?

Hi @van-open-birch

You might be able to do something with a Regular Expression here but the exact regex will depend on your specification:

  • Can you mix low-case and upper-case characters?
  • Can you use whitespace or digits?
  • Can you leave a blank line

You should note that you might need to model this is a Validation rule and not in the “Pattern” on the Field Editor as you cannot use the Pattern when Line Breaks are allowed. You should use the following syntax:

[YourField] PatternViolated "Your RegEx"

If all else fails, you can model a Validation Rule with a Custom Condition and add the exact specification to the code.

There’s an example custom condition shown here, Modeling & Development MMH: Custom Condition

Hello @van-open-birch , I am a member of the Discourse team. I can see that there was a new response to your question on the Topic of the discussion. Do you find it helpful, or should the question remain open?

Thanks ahead for your feedback and have a nice rest of the day!