Use regular expressions in form rules to validate field input in Resco Mobile CRM
Make sure your team won’t enter incorrect data into Resco Mobile CRM’s fields. In the Woodford configurator you can set up a form rule that checks the data format and notifies the user if the data doesn’t meet the required conditions.
For example, on the Contact entity we want to prevent users from entering a wrong e-mail address and phone number format into the E-mail and Phone fields.
How to set up the form rule?
Go to Woodford – Entity (Contact) – Forms – On Change Rule
The rule has 2 parts (branches), each of them ensuring correct data input format for a particular field:
1. If the user is changing the email address and its format is incorrect, the field becomes red (color is customizable) and a small exclamation mark appears in the corner of the field. The expected format is firstname.lastname@example.org or email@example.com.
The regular expression to add to the condition is:
2. If the user is adding a phone number and accidentally enters less digits than expected for a phone number, the field turns red (color is also fully customizable) and a small exclamation mark appears in the corner of the field. In this case, we want to ensure that users enters 9 digits.
The regular expression to add to this condition is:
Note: You can also set up a similar rule for On Save action to get the error message only when trying to save the form.
Once you’ve set up the rule and the Mobile CRM user enters an e-mail address (or phone number) in an incorrect format, the app will immediately notify him/her about the issue:
But when the data in the field meets all required conditions, the user can proceed with editing and saving the Contact form as usual:
Of course, it is possible to apply any other regular expressions that fit your requirements. To ensure that the expression is correct you can use the regex tester at https://regex101.com.
For even more quick tips on Resco Mobile CRM, its setup and configuration make sure to follow this blog. And for an in-depth training on all the capabilities, newest enhancements and the latest industry trends, make sure to join us in March at the upcoming American edition of the resco.next conference in Atlanta.