Use regular expressions in form rules to validate field input in Resco Mobile CRM

quicktip_fields

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 john@testcompany.com or john@test.company.com.

The regular expression to add to the condition is:

^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$

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:

^[0-9]{9}$

field_data_rule

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:

field_data_mcrm1

But when the data in the field meets all required conditions, the user can proceed with editing and saving the Contact form as usual:

field_data_mcrm2

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.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s