Skip to content
Home » Data Patterns

Data Patterns

Data Patterns: An introduction

A data pattern refers to a specific format or structure that is pre-defined for a particular field or property within an object. In CodelessONE, once a data pattern is set for a field, users are required to input data that strictly follows that pattern when creating or updating records. This ensures data consistency, accuracy, and validation across the system, preventing users from entering invalid or incorrectly formatted data.

For example, consider a telephone number in North America, which typically follows a standard format: a three-digit area code, a three-digit central office code, and a four-digit line number. If this pattern is applied to a phone number field in CodelessONE, users will be restricted to entering data in that specific format (e.g., 602-293-1234, where 602 is the area code for Phoenix, AZ, 293 is the central office code, and 1234 is the line number).

Another example is the International Bank Account Number (IBAN), which can be up to 34 characters long and includes a combination of letters and numbers. The pattern consists of two letters for the country code, two check digits, and up to 30 alphanumeric characters that vary based on the country. For instance, an IBAN for Ireland might look like “IE12 BOFI 9000 0112 3456 78.” CodelessONE can enforce this specific structure to ensure that IBANs are entered correctly during banking transactions.

In CodelessONE, data patterns are supported for Text type fields only. This means that whether the pattern involves alphanumeric characters, spaces, symbols like plus (+) or minus (), or other characters, the field’s property must be set to Text. This feature is particularly useful when developing systems where certain fields require data to follow a strict format, such as phone numbers, social security numbers, postal codes, and more.

By enforcing these patterns, CodelessONE ensures data integrity and helps avoid errors that can arise from incorrect data entry, thereby streamlining processes and enhancing system reliability.

Pattern Codes for enforcing the data pattern

For each type of data, a specific code is used. The complete list is as follows:

0 – For a digit (0-9)

9 – For a digit (0-9) or a space

– For a digit (0-9), space, plus (+), or minus (-)

L – For a letter (A-Z)

A – For an alphanumeric character (0-9, a-Z)

a – For an alphanumeric character (0-9, a-Z) or a space

& – For any character (excluding space)

C – For any character or a space

Users don’t have to memorize these codes. Hovering the mouse over  besides Pattern label shows a tooltip with all these rules.

Pattern Rules

Consider a scenario where a company is organized into three departments: HR, Finance, and Operations. When a new employee joins, they are assigned a unique Employee ID that will not be reused, even if the employee leaves the company. To maintain consistency and clarity, the company decides to follow a specific format for generating these Employee IDs.

The format is structured so that:

  • The first two characters represent the department name (e.g., “HR” for Human Resources, “FN” for Finance, or “OP” for Operations).
  • This is followed by a space.
  • The last part consists of a 5-digit number that uniquely identifies the employee.

For instance:

  • An employee in HR might receive an ID like “HR 00001“.
  • An employee in Finance could have an ID like “FN 00023“.
  • An employee in Operations might be assigned “OP 00157“.

In CodelessONE, this pattern can be implemented by setting a Data Pattern for the Employee ID field. Using the rules for data patterns, the format would be represented as LL900000, where:

  • LL corresponds to the two letters representing the department.
  • 9 represents a space.
  • 00000 represents the 5-digit number that will be unique for each employee.

By setting this pattern using the Pattern property of a Text field, CodelessONE ensures that users cannot enter Employee IDs that don’t follow this strict format. For example, an attempt to input an ID without a space, or with fewer or more than five digits, would be rejected by the system, ensuring data consistency and eliminating errors.

Data Pattern

Moreover, CodelessONE allows users to set a default value for new records. This means when a new employee record is created, the Employee ID field would be automatically populated with that value, which can then be edited as necessary. This further simplifies the data entry process, enhances accuracy, and ensures that every new employee is assigned an ID in line with the company’s predefined rules. An Important point to be noted here is Pattern does not support auto-incrementing sequence. This means that if we have set HR 00001 as the default value, then ALL new records would have this value as default, at the time of creation, and not as HR 00001, HR 00002, HR 00003 etc. incrementally.

Setting a pattern also disables the Minimum and Maximum properties.

Disabled properties