Apply Regex Validation PCF (PowerApps Component Framework)

Apply Regex Validation custom control is the Regex based field validation for text fields.

Instructions to use:

  1. Install the managed solution (available with the most latest release on GitHub Repository) in your Dynamics CRM instance.
  2. Open the Form Editor for the desired form of the required entity, select the field supported by this control (SingleLine.Text, SingleLine.Phone, SingleLine.Email) and click Change Properties and then select the Controls tab.
  3. In the Controls tab, click the Add Control... button, select Apply Regex Validation in the list of available controls and click Add.
  4. Select the types of client for which this control will be used.
  5. Property Input Text will be selected by default.
  6. Insert the Regex which you want to apply to the field for validation in the mandatory Regex Expression property.
  7. Insert the message which you want to show the user in the Field Notification property.
  8. If Field Notification property is left empty, default message will be Incorrect Format.
  9. Save settings of the custom control, save and publish the entity form.

Control Behaviour:

  1. On change of field value, if the value in the field doesn't satisfies the Regex, notification will be on field.
  2. On save of record, if the error notification on field exists, notification will be on top of form as well(OOB behaviour).

References: