1

There is a screen flow in which I have a long text area field. For that field I want to check that there are at least 5 characters entered in that field.

I was using the regex - REGEX({!Case_note},“^.{5,}$“) This works fine if I write everything on single line only.

But the issue is this doesn't work properly if someone enters two lines like below.

ashdj
ajsd

In the above text it throws error however there are more than 5 characters.

Can someone please help and give a REGEX which would consider the new line as well and just check that whole field has at least 5 characters?

Thanks.

1 Answer 1

1

Using the single-line flag should fix your problem:

REGEX({!Case_note},"^(?s).{5,}$")

Where (?s) means "enable single line mode," which causes . to include newline characters (it normally does not).

Alternatively, just use LEN:

LEN({!Case_Note}) >= 5
1
  • Thanks @sfdcfox I tried LEN but that doesn't show the error message and simply throw an error of unhandled exception at the end of the flow so can't really use that.. same with the one you gave it works fine if I write like "asdsa ass" but doesn't work if I write 2-3 characters and then hit enter twice it doesn't throw an error message and at the end of the flow it says the standard unhandled error occurred popup. any suggestion to get rid of that?
    – Jenil
    Commented Jan 29, 2021 at 3:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .