0

I need to validate input on a screen flow's text field so that only "EB, EO, GA" are acceptable inputs from the user (Normally I'd just use a picklist but the client wants to leverage an existing standard field and its Text type).

How would I go about handling this via a formula? Alternatively, just restricting it to being 2 all caps letters would suffice.

I tried using

LEN({!Text_Input_Field_From_Screen_Flow} <> 2) &&
REGEX({!Text_Input_Field_From_Screen_Flow}, "[A-Z] {2}")

but getting a syntax error: The formula expression is invalid: Incorrect parameter type for operate '<>'. Expected Text, received Number"

1
  • 2
    please use edit and show the Flow screen field's validation formula you coded
    – cropredy
    Commented Jun 2, 2023 at 21:44

1 Answer 1

1

I think the issue you are having is because the use of incorrect parentheses.

I would update my logic to this for only those specific values:

AND(
    LEN({!Text_Input_Field_From_Screen_Flow}) = 2,
    OR(
        {!Text_Input_Field_From_Screen_Flow} = "EB",
        {!Text_Input_Field_From_Screen_Flow} = "EO",
        {!Text_Input_Field_From_Screen_Flow} = "GA"
    )
)

And if you need more general solution for different values but only 2 characters use this:

AND(
    LEN({!Text_Input_Field_From_Screen_Flow}) = 2,
    REGEX({!Text_Input_Field_From_Screen_Flow}, "[A-Z]{2}")
)

You must log in to answer this question.

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