# 8.3 form text validation

**URL:** <https://forum.inductiveautomation.com/t/8-3-form-text-validation/111458>\
**Category:** Ignition\
**Tags:** ignition83, perspective\
**Created:** [October 14, 2025, 9:06pm UTC](https://forum.inductiveautomation.com/t/8-3-form-text-validation/111458 "2025-10-14T21:06:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rfolkes](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@rfolkes](https://forum.inductiveautomation.com/u/rfolkes)\
**Post date:** [October 14, 2025, 9:06pm UTC](https://forum.inductiveautomation.com/t/8-3-form-text-validation/111458/1 "2025-10-14T21:06:11Z")

</div>

for the new form tool.

anyone have a good method for adding a Not in (x,y,z) to text validation constraint.

For example form to insert into DB DeviceName but DeviceName must be unique.  
Have custom.Device = list of device names in DB [device01, device02, device03]  
then form field will show invalid if duplicate if in that list.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 14, 2025, 10:38pm UTC](https://forum.inductiveautomation.com/t/8-3-form-text-validation/111458/2 "2025-10-14T22:38:12Z")

</div>

Use the pattern validation, constructing a regex that uses 'negative lookahead' to confirm that the entire string supplied by the user does not match one of your known device names:  
[https://regex101.com/r/S04glN/1](https://regex101.com/r/S04glN/1)

The assembled regex, which looks like:  
`^(?!(device01|device02|device03)$).*$`

Can be generated by an expression populated by an array of strings in `this.custom.devices`:  
`stringFormat("^(?!(%s)$).*$", groupConcat({this.custom.devices}, "|"))`

And then you can define a custom error message for the pattern mismatch state:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/7/f766d4db39c976fb11a99c57f2a9818b91af221e.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/8/e8a94f0f0336aa63082adbfdeb864418bf4ad448.png)

---

<div class="post-metadata">

**Author:** ![deon.korb](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@deon.korb](https://forum.inductiveautomation.com/u/deon.korb)\
**Post date:** [October 15, 2025, 11:31am UTC](https://forum.inductiveautomation.com/t/8-3-form-text-validation/111458/3 "2025-10-15T11:31:40Z")

</div>

Is there a practical limit as to how long that list can be? I suppose it depends…

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 15, 2025, 4:10pm UTC](https://forum.inductiveautomation.com/t/8-3-form-text-validation/111458/4 "2025-10-15T16:10:04Z")

</div>

Seat of the pants answer without any real testing to back it up: I wouldn't put more than ~hundreds of items in there.

The "nice" thing about the way the form component works is you're passing that regex compilation + parsing load entirely onto the "user agent", aka wherever the Perspective session is actually running, so you're not killing your gateway asking it to parse a bunch of repetitive regexes.  
The not-nice thing in this case is that regex validation is very CPU bound, so a sufficiently complex regex and a sufficiently weak client device may noticeably struggle. You're also at the mercy of the user agent - it's entirely possible that a browser might choose to bail out of a long running regex validation entirely or do something else unexpected. As ever - client side validation is a _nicety_, but anything truly important must be validated on the server where you control the code.
