on 2025 Mar 20 1:22 PM
To ensure that no leading or trailing spaces are entered by a user in custom fields, what is the best approach? A regular expression prevented spaces between numbers but did not prohibit leading or trailing spaces.
Request clarification before answering.
I would recommend using a script that executes after changing the value of a custom field. In that script, you could get the last updated field and trim its value, then set the trimmed value back into the last updated field.
In Advanced Workflow's groovy:
def updatedField = form.getLastUpdatedField()
updatedField.setValue(updatedField.getValue().trim())
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
7 | |
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.