How-to
Short answer: Add a Regex validation to the text field. For "letters and numbers only", use the built-in No special characters validation. Formulas can't use regex, so use find() there.
Why it happens
- Regex works only as a field validation, not inside a formula.
- Kissflow doesn't accept a regex wrapped in slashes, such as
/^\d+$/.
How to fix it
To check a format with regex:
- Hover over the text field and click the Validation icon.
- Click +Add a validation rule and select Regex.
- Enter the pattern without surrounding slashes, for example:
- US phone number:
^\d{3}-\d{3}-\d{4}$ - Canadian postal code:
^[A-Z]\d[A-Z] \d[A-Z]\d$
- US phone number:
- Click Customize error message and describe the format you expect.
See validating a text expression using regex for more patterns.
To block symbols, add the No special characters, Letters only or Numbers only validation. See field validations.
To flag special characters in another field:
- Add a text field and make it computed.
- Use
IF(test_field.find("@") > 0 || test_field.find("#") > 0 || test_field.find("$") > 0, "N", ""), listing every character you want to catch.
For extraction that needs regex or loops, use a JavaScript on-change field event with kf.context.getField and kf.context.updateField. Field events need the Enterprise plan.
