Form Validation on empty values for a field
Comments
-
Hello All,
I noticed that when a user just enters a bunch space as a value for the textbox, the form can be completed. I have it set as a required value, but it hasnt resolved the issue. For a form, Is there a way check if the value for a textbox is null/empty to prevent the from from being submitted?
-
Hello Samuel,
To make sure the value being inputted is not an empty string, we can create a validation rule that can check that a textbox is not empty. With the form designer open:
[ul][li]In the “Properties Panel”, under Form Rules -> Validation Rules, add a new validation rule
[/li][/ul]
[img]att1[/img]
[ul][li]Name the rule, and either pick or create a new rule to be used. The rule designer will open.
[/li][li]Select “Edit Input Data”, specify a string input
[/li][/ul]
We can then define the rule to return true if the user input is null.[img]att2[/img]
Once the rule is defined. Save and close the rule designer. We will be brought back onto the form designer. To make sure that we are able Update the inputs for the step, and map the form component that will be used as an input for the rule.
For more details on setting up a validation rule/flow, we can use the following link from our documentation site.
-
This doesnt work. This only validates if the string is truly null, but if you pass a space, for example, the rule returns false as its not treating an empty string as null.
-
[color=rgb(29, 28, 29)][font=Slack-Lato, appleLogo, sans-serif]Hello,[/font][/color][color=rgb(29, 28, 29)][font=Slack-Lato, appleLogo, sans-serif]Please note that the system takes empty spaces as a value too.[/font][/color]
[color=rgb(29, 28, 29)][font=Slack-Lato, appleLogo, sans-serif]To overcome this you can use an active form flow where you can use a step Remove Spaces and IsEmpty rule which checks if the value is empty.[/font][/color]
[color=rgb(29, 28, 29)][font=Slack-Lato, appleLogo, sans-serif]These 2 steps combined will check if the string is anything other than spaces and validation can be set using the SetValidation step[/font][/color]
[color=rgb(29, 28, 29)][font=Slack-Lato, appleLogo, sans-serif]I have attached a screenshot and an export for your reference.[/font][/color]
[color=rgb(29, 28, 29)][font=Slack-Lato, appleLogo, sans-serif]Let me know if you have any questions.[/font][/color][color=rgb(29, 28, 29)][font=Slack-Lato, appleLogo, sans-serif]Regards[/font][/color]
[color=rgb(29, 28, 29)][font=Slack-Lato, appleLogo, sans-serif]Osman Zama[/font][/color][color=rgb(127, 140, 141)][font=Roboto][img]att1[/img]
[/font][/color]
Howdy, Stranger!
Categories
- 4.1K All Categories
- 61 General
- 11 Training
- 201 Installation / Setup
- 1.1K Flows
- 106 Rules
- 260 Administration
- 212 Portal
- 489 General Q & A
- 693 Forms
- 333 Reports
- 3 Designer Extensions
- 47 Example Flows
- 51 CSS Examples
- 1 Diagram Tile
- 7 Javascript Controls
- 178 Pages
- 5 Process Mining
- New Features
- 178 Datastructures
- 69 Repository
- 219 Integrations
- 28 Multi-Tenant
- 27 SDK
- 76 Modules
- 56 Settings
- 25 Active Directory
- 12 Version 7
- 35 Version 8
- 66 Lunch And Learn Questions